]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/gdtoa/gdtoaimp.h
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / StdLib / LibC / gdtoa / gdtoaimp.h
diff --git a/StdLib/LibC/gdtoa/gdtoaimp.h b/StdLib/LibC/gdtoa/gdtoaimp.h
deleted file mode 100644 (file)
index a5eaa72..0000000
+++ /dev/null
@@ -1,634 +0,0 @@
-/** @file\r
-  This is a variation on dtoa.c that converts arbitary binary\r
-  floating-point formats to and from decimal notation.  It uses\r
-  double-precision arithmetic internally, so there are still\r
-  various #ifdefs that adapt the calculations to the native\r
-  IEEE double-precision arithmetic.\r
-\r
-  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials are licensed and made available under\r
-  the terms and conditions of the BSD License that accompanies this distribution.\r
-  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  *****************************************************************\r
-\r
-  The author of this software is David M. Gay.\r
-\r
-  Copyright (C) 1998-2000 by Lucent Technologies\r
-  All Rights Reserved\r
-\r
-  Permission to use, copy, modify, and distribute this software and\r
-  its documentation for any purpose and without fee is hereby\r
-  granted, provided that the above copyright notice appear in all\r
-  copies and that both that the copyright notice and this\r
-  permission notice and warranty disclaimer appear in supporting\r
-  documentation, and that the name of Lucent or any of its entities\r
-  not be used in advertising or publicity pertaining to\r
-  distribution of the software without specific, written prior\r
-  permission.\r
-\r
-  LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\r
-  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\r
-  IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\r
-  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\r
-  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\r
-  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\r
-  ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\r
-  THIS SOFTWARE.\r
-\r
-  Please send bug reports to David M. Gay (dmg at acm dot org,\r
-  with " at " changed at "@" and " dot " changed to ".").\r
-\r
-  *****************************************************************\r
-\r
-  NetBSD: gdtoaimp.h,v 1.5.4.1 2007/05/07 19:49:06 pavel Exp\r
-**/\r
-\r
-/* On a machine with IEEE extended-precision registers, it is\r
- * necessary to specify double-precision (53-bit) rounding precision\r
- * before invoking strtod or dtoa.  If the machine uses (the equivalent\r
- * of) Intel 80x87 arithmetic, the call\r
- *  _control87(PC_53, MCW_PC);\r
- * does this with many compilers.  Whether this or another call is\r
- * appropriate depends on the compiler; for this to work, it may be\r
- * necessary to #include "float.h" or another system-dependent header\r
- * file.\r
- */\r
-\r
-/* strtod for IEEE-, VAX-, and IBM-arithmetic machines.\r
- *\r
- * This strtod returns a nearest machine number to the input decimal\r
- * string (or sets errno to ERANGE).  With IEEE arithmetic, ties are\r
- * broken by the IEEE round-even rule.  Otherwise ties are broken by\r
- * biased rounding (add half and chop).\r
- *\r
- * Inspired loosely by William D. Clinger's paper "How to Read Floating\r
- * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 112-126].\r
- *\r
- * Modifications:\r
- *\r
- *  1. We only require IEEE, IBM, or VAX double-precision\r
- *    arithmetic (not IEEE double-extended).\r
- *  2. We get by with floating-point arithmetic in a case that\r
- *    Clinger missed -- when we're computing d * 10^n\r
- *    for a small integer d and the integer n is not too\r
- *    much larger than 22 (the maximum integer k for which\r
- *    we can represent 10^k exactly), we may be able to\r
- *    compute (d*10^k) * 10^(e-k) with just one roundoff.\r
- *  3. Rather than a bit-at-a-time adjustment of the binary\r
- *    result in the hard case, we use floating-point\r
- *    arithmetic to determine the adjustment to within\r
- *    one bit; only in really hard cases do we need to\r
- *    compute a second residual.\r
- *  4. Because of 3., we don't need a large table of powers of 10\r
- *    for ten-to-e (just some small tables, e.g. of 10^k\r
- *    for 0 <= k <= 22).\r
- */\r
-\r
-/*\r
- * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least\r
- *  significant byte has the lowest address.\r
- * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most\r
- *  significant byte has the lowest address.\r
- * #define Long int on machines with 32-bit ints and 64-bit longs.\r
- * #define Sudden_Underflow for IEEE-format machines without gradual\r
- *  underflow (i.e., that flush to zero on underflow).\r
- * #define No_leftright to omit left-right logic in fast floating-point\r
- *  computation of dtoa.\r
- * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3.\r
- * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines\r
- *  that use extended-precision instructions to compute rounded\r
- *  products and quotients) with IBM.\r
- * #define ROUND_BIASED for IEEE-format with biased rounding.\r
- * #define Inaccurate_Divide for IEEE-format with correctly rounded\r
- *  products but inaccurate quotients, e.g., for Intel i860.\r
- * #define NO_LONG_LONG on machines that do not have a "long long"\r
- *  integer type (of >= 64 bits).  On such machines, you can\r
- *  #define Just_16 to store 16 bits per 32-bit Long when doing\r
- *  high-precision integer arithmetic.  Whether this speeds things\r
- *  up or slows things down depends on the machine and the number\r
- *  being converted.  If long long is available and the name is\r
- *  something other than "long long", #define Llong to be the name,\r
- *  and if "unsigned Llong" does not work as an unsigned version of\r
- *  Llong, #define #ULLong to be the corresponding unsigned type.\r
- * #define Bad_float_h if your system lacks a float.h or if it does not\r
- *  define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,\r
- *  FLT_RADIX, FLT_ROUNDS, and DBL_MAX.\r
- * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)\r
- *  if memory is available and otherwise does something you deem\r
- *  appropriate.  If MALLOC is undefined, malloc will be invoked\r
- *  directly -- and assumed always to succeed.\r
- * #define Omit_Private_Memory to omit logic (added Jan. 1998) for making\r
- *  memory allocations from a private pool of memory when possible.\r
- *  When used, the private pool is PRIVATE_MEM bytes long:  2304 bytes,\r
- *  unless #defined to be a different length.  This default length\r
- *  suffices to get rid of MALLOC calls except for unusual cases,\r
- *  such as decimal-to-binary conversion of a very long string of\r
- *  digits.  When converting IEEE double precision values, the\r
- *  longest string gdtoa can return is about 751 bytes long.  For\r
- *  conversions by strtod of strings of 800 digits and all gdtoa\r
- *  conversions of IEEE doubles in single-threaded executions with\r
- *  8-byte pointers, PRIVATE_MEM >= 7400 appears to suffice; with\r
- *  4-byte pointers, PRIVATE_MEM >= 7112 appears adequate.\r
- * #define INFNAN_CHECK on IEEE systems to cause strtod to check for\r
- *  Infinity and NaN (case insensitively).\r
- *  When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined,\r
- *  strtodg also accepts (case insensitively) strings of the form\r
- *  NaN(x), where x is a string of hexadecimal digits and spaces;\r
- *  if there is only one string of hexadecimal digits, it is taken\r
- *  for the fraction bits of the resulting NaN; if there are two or\r
- *  more strings of hexadecimal digits, each string is assigned\r
- *  to the next available sequence of 32-bit words of fractions\r
- *  bits (starting with the most significant), right-aligned in\r
- *  each sequence.\r
- * #define MULTIPLE_THREADS if the system offers preemptively scheduled\r
- *  multiple threads.  In this case, you must provide (or suitably\r
- *  #define) two locks, acquired by ACQUIRE_DTOA_LOCK(n) and freed\r
- *  by FREE_DTOA_LOCK(n) for n = 0 or 1.  (The second lock, accessed\r
- *  in pow5mult, ensures lazy evaluation of only one copy of high\r
- *  powers of 5; omitting this lock would introduce a small\r
- *  probability of wasting memory, but would otherwise be harmless.)\r
- *  You must also invoke freedtoa(s) to free the value s returned by\r
- *  dtoa.  You may do so whether or not MULTIPLE_THREADS is #defined.\r
- * #define IMPRECISE_INEXACT if you do not care about the setting of\r
- *  the STRTOG_Inexact bits in the special case of doing IEEE double\r
- *  precision conversions (which could also be done by the strtog in\r
- *  dtoa.c).\r
- * #define NO_HEX_FP to disable recognition of C9x's hexadecimal\r
- *  floating-point constants.\r
- * #define -DNO_ERRNO to suppress setting errno (in strtod.c and\r
- *  strtodg.c).\r
- * #define NO_STRING_H to use private versions of memcpy.\r
- *  On some K&R systems, it may also be necessary to\r
- *  #define DECLARE_SIZE_T in this case.\r
- * #define YES_ALIAS to permit aliasing certain double values with\r
- *  arrays of ULongs.  This leads to slightly better code with\r
- *  some compilers and was always used prior to 19990916, but it\r
- *  is not strictly legal and can cause trouble with aggressively\r
- *  optimizing compilers (e.g., gcc 2.95.1 under -O2).\r
- * #define USE_LOCALE to use the current locale's decimal_point value.\r
- */\r
-\r
-/* #define IEEE_{BIG,LITTLE}_ENDIAN in ${ARCHDIR}/gdtoa/arith.h */\r
-#include  <LibConfig.h>\r
-\r
-#include <stdint.h>\r
-#define Short   int16_t\r
-#define UShort uint16_t\r
-#define Long    int32_t\r
-#define ULong  uint32_t\r
-#define LLong   int64_t\r
-#define ULLong uint64_t\r
-\r
-#define INFNAN_CHECK\r
-#ifdef _REENTRANT\r
-#define MULTIPLE_THREADS\r
-#endif\r
-#define USE_LOCALE\r
-\r
-#ifndef GDTOAIMP_H_INCLUDED\r
-#define GDTOAIMP_H_INCLUDED\r
-#include "gdtoa.h"\r
-#include "gd_qnan.h"\r
-\r
-#ifdef DEBUG\r
-#include "stdio.h"\r
-#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);}\r
-#endif\r
-\r
-#include "stdlib.h"\r
-#include "string.h"\r
-\r
-#define Char void\r
-\r
-#ifdef MALLOC\r
-extern Char *MALLOC ANSI((size_t));\r
-#else\r
-#define MALLOC malloc\r
-#endif\r
-\r
-#undef IEEE_Arith\r
-#undef Avoid_Underflow\r
-#ifdef IEEE_BIG_ENDIAN\r
-#define IEEE_Arith\r
-#endif\r
-#ifdef IEEE_LITTLE_ENDIAN\r
-#define IEEE_Arith\r
-#endif\r
-\r
-#include "errno.h"\r
-#ifdef Bad_float_h\r
-\r
-#ifdef IEEE_Arith\r
-#define DBL_DIG 15\r
-#define DBL_MAX_10_EXP 308\r
-#define DBL_MAX_EXP 1024\r
-#define FLT_RADIX 2\r
-#define DBL_MAX 1.7976931348623157e+308\r
-#endif\r
-\r
-#ifndef LONG_MAX\r
-#define LONG_MAX 2147483647\r
-#endif\r
-\r
-#else /* ifndef Bad_float_h */\r
-#include "float.h"\r
-#endif /* Bad_float_h */\r
-\r
-#ifdef IEEE_Arith\r
-#define Scale_Bit 0x10\r
-#define n_bigtens 5\r
-#endif\r
-\r
-#include "math.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) != 1\r
-Exactly one of IEEE_LITTLE_ENDIAN or IEEE_BIG_ENDIAN should be defined.\r
-#endif\r
-\r
-/*  This union assumes that:\r
-      sizeof(double) == 8\r
-      sizeof(UINT32) == 4\r
-\r
-    If this is not the case, the type and dimension of the L member will\r
-    have to be modified.\r
-*/\r
-typedef union { double d; UINT32 L[2]; } U;\r
-\r
-#ifdef YES_ALIAS\r
-#define dval(x) x\r
-#ifdef IEEE_LITTLE_ENDIAN\r
-#define word0(x) ((ULong *)&x)[1]\r
-#define word1(x) ((ULong *)&x)[0]\r
-#else\r
-#define word0(x) ((ULong *)&x)[0]\r
-#define word1(x) ((ULong *)&x)[1]\r
-#endif\r
-#else /* !YES_ALIAS */\r
-#ifdef IEEE_LITTLE_ENDIAN\r
-#define word0(x)  ( /* LINTED */ (U*)&x)->L[1]\r
-#define word1(x)  ( /* LINTED */ (U*)&x)->L[0]\r
-#else\r
-#define word0(x)  ( /* LINTED */ (U*)&x)->L[0]\r
-#define word1(x)  ( /* LINTED */ (U*)&x)->L[1]\r
-#endif\r
-#define dval(x)   ( /* LINTED */ (U*)&x)->d\r
-#endif /* YES_ALIAS */\r
-\r
-/* The following definition of Storeinc is appropriate for MIPS processors.\r
- * An alternative that might be better on some machines is\r
- * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)\r
- */\r
-#if defined(IEEE_LITTLE_ENDIAN)\r
-#define Storeinc(a,b,c) \\r
- (((unsigned short *)(void *)a)[1] = (unsigned short)b, \\r
-  ((unsigned short *)(void *)a)[0] = (unsigned short)c, \\r
-  a++)\r
-#else\r
-#define Storeinc(a,b,c) \\r
- (((unsigned short *)(void *)a)[0] = (unsigned short)b, \\r
-  ((unsigned short *)(void *)a)[1] = (unsigned short)c, \\r
-  a++)\r
-#endif\r
-\r
-/* #define P DBL_MANT_DIG */\r
-/* Ten_pmax = floor(P*log(2)/log(5)) */\r
-/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */\r
-/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */\r
-/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */\r
-\r
-#ifdef IEEE_Arith\r
-#define Exp_shift  20\r
-#define Exp_shift1 20\r
-#define Exp_msk1    0x100000\r
-#define Exp_msk11   0x100000\r
-#define Exp_mask  0x7ff00000\r
-#define P 53\r
-#define Bias 1023\r
-#define Emin (-1022)\r
-#define Exp_1  0x3ff00000\r
-#define Exp_11 0x3ff00000\r
-#define Ebits 11\r
-#define Frac_mask  0xfffffU\r
-#define Frac_mask1 0xfffffU\r
-#define Ten_pmax 22\r
-#define Bletch 0x10\r
-#define Bndry_mask  0xfffffU\r
-#define Bndry_mask1 0xfffffU\r
-#define LSB 1\r
-#define Sign_bit 0x80000000\r
-#define Log2P 1\r
-#define Tiny0 0\r
-#define Tiny1 1\r
-#define Quick_max 14\r
-#define Int_max 14\r
-\r
-#ifndef Flt_Rounds\r
-#ifdef FLT_ROUNDS\r
-#define Flt_Rounds FLT_ROUNDS\r
-#else\r
-#define Flt_Rounds 1\r
-#endif\r
-#endif /*Flt_Rounds*/\r
-\r
-#else /* ifndef IEEE_Arith */\r
-#undef  Sudden_Underflow\r
-#define Sudden_Underflow\r
-#ifdef IBM\r
-#undef Flt_Rounds\r
-#define Flt_Rounds 0\r
-#define Exp_shift  24\r
-#define Exp_shift1 24\r
-#define Exp_msk1   0x1000000\r
-#define Exp_msk11  0x1000000\r
-#define Exp_mask  0x7f000000\r
-#define P 14\r
-#define Bias 65\r
-#define Exp_1  0x41000000\r
-#define Exp_11 0x41000000\r
-#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */\r
-#define Frac_mask  0xffffff\r
-#define Frac_mask1 0xffffff\r
-#define Bletch 4\r
-#define Ten_pmax 22\r
-#define Bndry_mask  0xefffff\r
-#define Bndry_mask1 0xffffff\r
-#define LSB 1\r
-#define Sign_bit 0x80000000\r
-#define Log2P 4\r
-#define Tiny0 0x100000\r
-#define Tiny1 0\r
-#define Quick_max 14\r
-#define Int_max 15\r
-#else /* VAX */\r
-#undef Flt_Rounds\r
-#define Flt_Rounds 1\r
-#define Exp_shift  23\r
-#define Exp_shift1 7\r
-#define Exp_msk1    0x80\r
-#define Exp_msk11   0x800000\r
-#define Exp_mask  0x7f80\r
-#define P 56\r
-#define Bias 129\r
-#define Exp_1  0x40800000\r
-#define Exp_11 0x4080\r
-#define Ebits 8\r
-#define Frac_mask  0x7fffff\r
-#define Frac_mask1 0xffff007f\r
-#define Ten_pmax 24\r
-#define Bletch 2\r
-#define Bndry_mask  0xffff007f\r
-#define Bndry_mask1 0xffff007f\r
-#define LSB 0x10000\r
-#define Sign_bit 0x8000\r
-#define Log2P 1\r
-#define Tiny0 0x80\r
-#define Tiny1 0\r
-#define Quick_max 15\r
-#define Int_max 15\r
-#endif /* IBM, VAX */\r
-#endif /* IEEE_Arith */\r
-\r
-#ifndef IEEE_Arith\r
-#define ROUND_BIASED\r
-#endif\r
-\r
-#ifdef RND_PRODQUOT\r
-#define rounded_product(a,b) a = rnd_prod(a, b)\r
-#define rounded_quotient(a,b) a = rnd_quot(a, b)\r
-extern double rnd_prod(double, double), rnd_quot(double, double);\r
-#else\r
-#define rounded_product(a,b) a *= b\r
-#define rounded_quotient(a,b) a /= b\r
-#endif\r
-\r
-#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1))\r
-#define Big1 0xffffffffU\r
-\r
-#undef  Pack_16\r
-#ifndef Pack_32\r
-#define Pack_32\r
-#endif\r
-\r
-#ifdef NO_LONG_LONG\r
-#undef ULLong\r
-#ifdef Just_16\r
-#undef Pack_32\r
-#define Pack_16\r
-/* When Pack_32 is not defined, we store 16 bits per 32-bit Long.\r
- * This makes some inner loops simpler and sometimes saves work\r
- * during multiplications, but it often seems to make things slightly\r
- * slower.  Hence the default is now to store 32 bits per Long.\r
- */\r
-#endif\r
-#else /* long long available */\r
-#ifndef Llong\r
-#define Llong long long\r
-#endif\r
-#ifndef ULLong\r
-#define ULLong unsigned Llong\r
-#endif\r
-#endif /* NO_LONG_LONG */\r
-\r
-#ifdef Pack_32\r
-#define ULbits 32\r
-#define kshift 5\r
-#define kmask 31\r
-#define ALL_ON 0xffffffff\r
-#else\r
-#define ULbits 16\r
-#define kshift 4\r
-#define kmask 15\r
-#define ALL_ON 0xffff\r
-#endif\r
-\r
-#ifndef MULTIPLE_THREADS\r
-#define ACQUIRE_DTOA_LOCK(n)  /*nothing*/\r
-#define FREE_DTOA_LOCK(n) /*nothing*/\r
-#else\r
-#include "reentrant.h"\r
-\r
-extern mutex_t __gdtoa_locks[2];\r
-\r
-#define ACQUIRE_DTOA_LOCK(n)  \\r
-  do {              \\r
-    if (__isthreaded)       \\r
-      mutex_lock(&__gdtoa_locks[n]);    \\r
-  } while (/* CONSTCOND */ 0)\r
-#define FREE_DTOA_LOCK(n) \\r
-  do {              \\r
-    if (__isthreaded)       \\r
-      mutex_unlock(&__gdtoa_locks[n]);  \\r
-  } while (/* CONSTCOND */ 0)\r
-#endif\r
-\r
-#define Kmax (sizeof(size_t) << 3)\r
-\r
- struct\r
-Bigint {\r
-  struct Bigint *next;\r
-  int k, maxwds, sign, wds;\r
-  ULong x[1];\r
-  };\r
-\r
- typedef struct Bigint Bigint;\r
-\r
-#ifdef NO_STRING_H\r
-#ifdef DECLARE_SIZE_T\r
-typedef unsigned int size_t;\r
-#endif\r
-extern void memcpy_D2A ANSI((void*, const void*, size_t));\r
-#define Bcopy(x,y) memcpy_D2A(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int))\r
-#else /* !NO_STRING_H */\r
-#define Bcopy(x,y) memcpy(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int))\r
-#endif /* NO_STRING_H */\r
-\r
-#define Balloc        __Balloc_D2A\r
-#define Bfree         __Bfree_D2A\r
-#define ULtoQ         __ULtoQ_D2A\r
-#define ULtof         __ULtof_D2A\r
-#define ULtod         __ULtod_D2A\r
-#define ULtodd        __ULtodd_D2A\r
-#define ULtox         __ULtox_D2A\r
-#define ULtoxL        __ULtoxL_D2A\r
-#define any_on        __any_on_D2A\r
-#define b2d           __b2d_D2A\r
-#define bigtens       __bigtens_D2A\r
-#define cmp           __cmp_D2A\r
-#define copybits      __copybits_D2A\r
-#define d2b           __d2b_D2A\r
-#define decrement     __decrement_D2A\r
-#define diff          __diff_D2A\r
-#define dtoa_result   __dtoa_result_D2A\r
-#define g__fmt        __g__fmt_D2A\r
-#define gethex        __gethex_D2A\r
-#define hexdig        __hexdig_D2A\r
-#define hexdig_init_D2A __hexdig_init_D2A\r
-#define hexnan        __hexnan_D2A\r
-#define hi0bits       __hi0bits_D2A\r
-#define hi0bits_D2A   __hi0bits_D2A\r
-#define i2b           __i2b_D2A\r
-#define increment     __increment_D2A\r
-#define lo0bits       __lo0bits_D2A\r
-#define lshift        __lshift_D2A\r
-#define match         __match_D2A\r
-#define mult          __mult_D2A\r
-#define multadd       __multadd_D2A\r
-#define nrv_alloc     __nrv_alloc_D2A\r
-#define pow5mult      __pow5mult_D2A\r
-#define quorem        __quorem_D2A\r
-#define ratio         __ratio_D2A\r
-#define rshift        __rshift_D2A\r
-#define rv_alloc      __rv_alloc_D2A\r
-#define s2b           __s2b_D2A\r
-#define set_ones      __set_ones_D2A\r
-#define strcp         __strcp_D2A\r
-#define strcp_D2A     __strcp_D2A\r
-#define strtoIg       __strtoIg_D2A\r
-#define sum           __sum_D2A\r
-#define tens          __tens_D2A\r
-#define tinytens      __tinytens_D2A\r
-#define tinytens      __tinytens_D2A\r
-#define trailz        __trailz_D2A\r
-#define ulp           __ulp_D2A\r
-\r
-extern char          *dtoa_result;\r
-extern CONST double   bigtens[], tens[], tinytens[];\r
-extern unsigned char  hexdig[];\r
-\r
-extern Bigint  *Balloc      (int);\r
-extern void     Bfree       (Bigint*);\r
-extern void     ULtof       (ULong*, ULong*, Long, int);\r
-extern void     ULtod       (ULong*, ULong*, Long, int);\r
-extern void     ULtodd      (ULong*, ULong*, Long, int);\r
-extern void     ULtoQ       (ULong*, ULong*, Long, int);\r
-extern void     ULtox       (UShort*, ULong*, Long, int);\r
-extern void     ULtoxL      (ULong*, ULong*, Long, int);\r
-extern ULong    any_on      (Bigint*, int);\r
-extern double   b2d         (Bigint*, int*);\r
-extern int      cmp         (Bigint*, Bigint*);\r
-extern void     copybits    (ULong*, int, Bigint*);\r
-extern Bigint  *d2b         (double, int*, int*);\r
-extern int      decrement   (Bigint*);\r
-extern Bigint  *diff        (Bigint*, Bigint*);\r
-extern char    *dtoa        (double d, int mode, int ndigits,\r
-                                  int *decpt, int *sign, char **rve);\r
-extern char    *g__fmt      (char*, char*, char*, int, ULong);\r
-extern int      gethex      (CONST char**, CONST FPI*, Long*, Bigint**, int);\r
-extern void     hexdig_init_D2A(Void);\r
-extern int      hexnan      (CONST char**, CONST FPI*, ULong*);\r
-extern int      hi0bits_D2A (ULong);\r
-extern Bigint  *i2b         (int);\r
-extern Bigint  *increment   (Bigint*);\r
-extern int      lo0bits     (ULong*);\r
-extern Bigint  *lshift      (Bigint*, int);\r
-extern int      match       (CONST char**, CONST char*);\r
-extern Bigint  *mult        (Bigint*, Bigint*);\r
-extern Bigint  *multadd     (Bigint*, int, int);\r
-extern char    *nrv_alloc   (CONST char*, char **, size_t);\r
-extern Bigint  *pow5mult    (Bigint*, int);\r
-extern int      quorem      (Bigint*, Bigint*);\r
-extern double   ratio       (Bigint*, Bigint*);\r
-extern void     rshift      (Bigint*, int);\r
-extern char    *rv_alloc    (size_t);\r
-extern Bigint  *s2b         (CONST char*, int, int, ULong);\r
-extern Bigint  *set_ones    (Bigint*, int);\r
-extern char    *strcp       (char*, const char*);\r
-extern int      strtoIg     (CONST char*, char**, FPI*, Long*, Bigint**, int*);\r
-extern double   strtod      (const char *s00, char **se);\r
-extern Bigint  *sum         (Bigint*, Bigint*);\r
-extern int      trailz      (CONST Bigint*);\r
-extern double   ulp         (double);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-/*\r
- * NAN_WORD0 and NAN_WORD1 are only referenced in strtod.c.  Prior to\r
- * 20050115, they used to be hard-wired here (to 0x7ff80000 and 0,\r
- * respectively), but now are determined by compiling and running\r
- * qnan.c to generate gd_qnan.h, which specifies d_QNAN0 and d_QNAN1.\r
- * Formerly gdtoaimp.h recommended supplying suitable -DNAN_WORD0=...\r
- * and -DNAN_WORD1=...  values if necessary.  This should still work.\r
- * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.)\r
- */\r
-#ifdef IEEE_Arith\r
-#ifdef IEEE_BIG_ENDIAN\r
-#define _0 0\r
-#define _1 1\r
-#ifndef NAN_WORD0\r
-#define NAN_WORD0 d_QNAN0\r
-#endif\r
-#ifndef NAN_WORD1\r
-#define NAN_WORD1 d_QNAN1\r
-#endif\r
-#else\r
-#define _0 1\r
-#define _1 0\r
-#ifndef NAN_WORD0\r
-#define NAN_WORD0 d_QNAN1\r
-#endif\r
-#ifndef NAN_WORD1\r
-#define NAN_WORD1 d_QNAN0\r
-#endif\r
-#endif\r
-#else\r
-#undef INFNAN_CHECK\r
-#endif\r
-\r
-#undef SI\r
-#ifdef Sudden_Underflow\r
-#define SI 1\r
-#else\r
-#define SI 0\r
-#endif\r
-\r
-#endif /* GDTOAIMP_H_INCLUDED */\r