drm/i915: Use dev->pdev to get PCI device revisions
[dragonfly.git] / contrib / gmp / mpf / dump.c
blobded3606cc35986ee353377bc837783579381f53d
1 /* mpf_dump -- Dump a float to stdout.
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.
8 Copyright 1993, 1994, 1995, 2000, 2001 Free Software Foundation, Inc.
10 This file is part of the GNU MP Library.
12 The GNU MP Library is free software; you can redistribute it and/or modify
13 it under the terms of the GNU Lesser General Public License as published by
14 the Free Software Foundation; either version 3 of the License, or (at your
15 option) any later version.
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
19 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20 License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
25 #include <stdio.h>
26 #include <string.h> /* for strlen */
27 #include "gmp.h"
28 #include "gmp-impl.h"
30 void
31 mpf_dump (mpf_srcptr u)
33 mp_exp_t exp;
34 char *str;
36 str = mpf_get_str (0, &exp, 10, 0, u);
37 if (str[0] == '-')
38 printf ("-0.%se%ld\n", str + 1, exp);
39 else
40 printf ("0.%se%ld\n", str, exp);
41 (*__gmp_free_func) (str, strlen (str) + 1);