[BACK]Return to dump.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpf

Annotation of OpenXM_contrib/gmp/mpf/dump.c, Revision 1.1.1.2

1.1       maekawa     1: /* mpf_dump -- Dump a float to stdout.
                      2:
1.1.1.2 ! maekawa     3:    THIS IS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE.  IT IS NOT SAFE TO
        !             4:    CALL THIS FUNCTION DIRECTLY.  IN FACT, IT IS ALMOST GUARANTEED THAT THIS
        !             5:    FUNCTION WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
        !             6:
        !             7:
        !             8: Copyright (C) 1993, 1994, 1995, 2000 Free Software Foundation, Inc.
1.1       maekawa     9:
                     10: This file is part of the GNU MP Library.
                     11:
                     12: The GNU MP Library is free software; you can redistribute it and/or modify
1.1.1.2 ! maekawa    13: it under the terms of the GNU Lesser General Public License as published by
        !            14: the Free Software Foundation; either version 2.1 of the License, or (at your
1.1       maekawa    15: option) any later version.
                     16:
                     17: The GNU MP Library is distributed in the hope that it will be useful, but
                     18: WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1.1.1.2 ! maekawa    19: or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
1.1       maekawa    20: License for more details.
                     21:
1.1.1.2 ! maekawa    22: You should have received a copy of the GNU Lesser General Public License
1.1       maekawa    23: along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
                     24: the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
                     25: MA 02111-1307, USA. */
                     26:
                     27: #include <stdio.h>
                     28: #include "gmp.h"
                     29: #include "gmp-impl.h"
                     30:
                     31: void
                     32: #if __STDC__
                     33: mpf_dump (mpf_srcptr u)
                     34: #else
                     35: mpf_dump (u)
                     36:      mpf_srcptr u;
                     37: #endif
                     38: {
                     39:   mp_exp_t exp;
                     40:   char *str;
                     41:
                     42:   str = mpf_get_str (0, &exp, 10, 0, u);
                     43:   if (str[0] == '-')
                     44:     printf ("-0.%se%ld\n", str + 1, exp);
                     45:   else
                     46:     printf ("0.%se%ld\n", str, exp);
                     47:   (*_mp_free_func) (str, 0);/* ??? broken alloc interface, pass what size ??? */
                     48: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>