292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
-
+
-
+
-
+
|
};
/*
* Static functions defined in this file.
*/
static bool AccumulateDecimalDigit(unsigned, int,
Tcl_WideUInt *, mp_int *, int);
Tcl_WideUInt *, mp_int *, bool);
static double MakeHighPrecisionDouble(int signum,
mp_int *significand, int nSigDigs, int exponent);
static double MakeLowPrecisionDouble(int signum,
Tcl_WideUInt significand, int nSigDigs,
int exponent);
#ifdef IEEE_FLOATING_POINT
static double MakeNaN(int signum, Tcl_WideUInt tag);
#endif
static double RefineApproximation(double approx,
mp_int *exactSignificand, int exponent);
static mp_err MulPow5(mp_int *, unsigned, mp_int *) MP_WUR;
static int NormalizeRightward(Tcl_WideUInt *);
static int RequiredPrecision(Tcl_WideUInt);
static void DoubleToExpAndSig(double, Tcl_WideUInt *, int *,
int *);
static void TakeAbsoluteValue(Double *, int *);
static char * FormatInfAndNaN(Double *, int *, char **);
static char * FormatZero(int *, char **);
static int ApproximateLog10(Tcl_WideUInt, int, int);
static int BetterLog10(double, int, int *);
static int BetterLog10(double, int, bool *);
static void ComputeScale(int, int, int *, int *, int *, int *);
static void SetPrecisionLimits(int, int, int *, int *, int *,
int *);
static char * BumpUp(char *, char *, int *);
static int AdjustRange(double *, int);
static char * ShorteningQuickFormat(double, int, int, double,
char *, int *);
static char * StrictQuickFormat(double, int, int, double,
char *, int *);
static char * QuickConversion(double, int, int, int, int, int, int,
static char * QuickConversion(double, int, bool, int, int, int, int,
int *, char **);
static void CastOutPowersOf2(int *, int *, int *);
static char * ShorteningInt64Conversion(Double *, Tcl_WideUInt,
int, int, int, int, int, int, int, int, int,
int, int, int *, char **);
static char * StrictInt64Conversion(Tcl_WideUInt,
int, int, int, int, int, int,
|
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
|
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
|
-
+
|
*----------------------------------------------------------------------
*/
static inline char *
QuickConversion(
double e, /* Number to format. */
int k, /* floor(log10(d)), approximately. */
int k_check, /* 0 if k is exact, 1 if it may be too high */
bool k_check, /* false if k is exact, true if it may be too high */
int flags, /* Flags passed to dtoa:
* TCL_DD_SHORTEST */
int len, /* Length of the return value. */
int ilim, /* Number of digits to store. */
int ilim1, /* Number of digits to store if we misguessed
* k. */
int *decpt, /* OUTPUT: Location of the decimal point. */
|