Tcl Source Code

Check-in [70302ff935]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge TIP #488 implementation. Some clean-up in tommath implementation (remove internal stub entries which are no longer needed)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 70302ff935356c095e2786cbb4fb2ca5781fc03c6fa36207dfcc93a9deca579c
User & Date: jan.nijtmans 2017-12-15 15:02:42
Context
2017-12-15
19:55
merge trunk check-in: 878d1b77fd user: jan.nijtmans tags: memory-API
17:04
merge mark check-in: 30cbf759b2 user: dgp tags: trunk
16:06
merge trunk check-in: e3d9fa3868 user: jan.nijtmans tags: novem
15:02
Merge TIP #488 implementation. Some clean-up in tommath implementation (remove internal stub entrie... check-in: 70302ff935 user: jan.nijtmans tags: trunk
14:46
Mark TclPrecTraceProc() as deprecated, and remove it when compiling with -DTCL_NO_DEPRECATED. See TI... check-in: 8f2ba4c41d user: jan.nijtmans tags: core-8-branch
2017-12-13
10:34
core-8-branch merge: Use nmakehlp -L to locate directories check-in: 0fc454593c user: apnadkarni tags: trunk
2017-12-01
12:24
remove many test-cases related to tcl_precision Closed-Leaf check-in: 421523d6cd user: jan.nijtmans tags: tip-488
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/PrintDbl.3.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.nf
\fB#include <tcl.h>\fR
.sp
\fBTcl_PrintDouble\fR(\fIinterp, value, dst\fR)
.SH ARGUMENTS
.AS Tcl_Interp *interp out
.AP Tcl_Interp *interp in
Before Tcl 8.0, the \fBtcl_precision\fR variable in this interpreter
controlled the conversion.  As of Tcl 8.0, this argument is ignored and
the conversion is controlled by the \fBtcl_precision\fR variable
that is now shared by all interpreters.
.AP double value in
Floating-point value to be converted.
.AP char *dst out
Where to store the string representing \fIvalue\fR.  Must have at
least \fBTCL_DOUBLE_SPACE\fR characters of storage.
.BE
.SH DESCRIPTION
................................................................................
.QW .
or an
.QW e
so that it does not look like an integer.  Where \fB%g\fR would
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
.QW .0 .
.PP
If the \fBtcl_precision\fR value is non-zero, the result will have
precisely that many digits of significance.  If the value is zero
(the default), the result will have the fewest digits needed to
represent the number in such a way that \fBTcl_NewDoubleObj\fR
will generate the same number when presented with the given string.
IEEE semantics of rounding to even apply to the conversion.
.SH KEYWORDS
conversion, double-precision, floating-point, string






<
|
<
<







 







<
<
|





14
15
16
17
18
19
20

21


22
23
24
25
26
27
28
..
34
35
36
37
38
39
40


41
42
43
44
45
46
.nf
\fB#include <tcl.h>\fR
.sp
\fBTcl_PrintDouble\fR(\fIinterp, value, dst\fR)
.SH ARGUMENTS
.AS Tcl_Interp *interp out
.AP Tcl_Interp *interp in

This argument is ignored.


.AP double value in
Floating-point value to be converted.
.AP char *dst out
Where to store the string representing \fIvalue\fR.  Must have at
least \fBTCL_DOUBLE_SPACE\fR characters of storage.
.BE
.SH DESCRIPTION
................................................................................
.QW .
or an
.QW e
so that it does not look like an integer.  Where \fB%g\fR would
generate an integer with no decimal point, \fBTcl_PrintDouble\fR adds
.QW .0 .
.PP


The result will have the fewest digits needed to
represent the number in such a way that \fBTcl_NewDoubleObj\fR
will generate the same number when presented with the given string.
IEEE semantics of rounding to even apply to the conversion.
.SH KEYWORDS
conversion, double-precision, floating-point, string

Changes to doc/tclvars.n.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH tclvars n 8.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_precision, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
.BE
.SH DESCRIPTION
.PP
The following global variables are created and managed automatically
by the Tcl library.  Except where noted below, these variables should
normally be treated as read-only by application-specific code and by users.
.TP
................................................................................
.TP
\fBwordSize\fR
.
This gives the size of the native-machine word in bytes (strictly, it
is same as the result of evaluating \fIsizeof(long)\fR in C.)
.RE
.TP
\fBtcl_precision\fR
.
This variable controls the number of digits to generate
when converting floating-point values to strings.  It defaults
to 0.  \fIApplications should not change this value;\fR it is
provided for compatibility with legacy code.
.PP
.RS
The default value of 0 is special, meaning that Tcl should
convert numbers using as few digits as possible while still
distinguishing any floating point number from its nearest
neighbours.  It differs from using an arbitrarily high value
for \fItcl_precision\fR in that an inexact number like \fI1.4\fR
will convert as \fI1.4\fR rather than \fI1.3999999999999999\fR
even though the latter is nearer to the exact value of the
binary number.
.RE
.PP
.RS
If \fBtcl_precision\fR is not zero, then when Tcl converts a floating
point number, it creates a decimal representation of at most
\fBtcl_precision\fR significant digits; the result may be shorter if
the shorter result represents the original number exactly. If no
result of at most \fBtcl_precision\fR digits is an exact representation
of the original number, the one that is closest to the original
number is chosen.
If the original number lies precisely between two equally accurate
decimal representations, then the one with an even value for the least
significant digit is chosen; for instance, if \fBtcl_precision\fR is 3, then
0.3125 will convert to 0.312, not 0.313, while 0.6875 will convert to
0.688, not 0.687. Any string of trailing zeroes that remains is trimmed.
.RE
.PP
.RS
a \fBtcl_precision\fR value of 17 digits is
.QW perfect
for IEEE floating-point in that it allows
double-precision values to be converted to strings and back to
binary with no loss of information. For this reason, you will often
see it as a value in legacy code that must run on Tcl versions before
8.5. It is no longer recommended; as noted above, a zero value is the
preferred method.
.RE
.PP
.RS
All interpreters in a thread share a single \fBtcl_precision\fR value:
changing it in one interpreter will affect all other interpreters as
well.  Safe interpreters are not allowed to modify the
variable.
.RE
.PP
.RS
Valid values for \fBtcl_precision\fR range from 0 to 17.
.RE
.TP
\fBtcl_rcFileName\fR
.
This variable is used during initialization to indicate the name of a
user-specific startup file.  If it is set by application-specific
initialization, then the Tcl startup code will check for the existence
of this file and \fBsource\fR it if it exists.  For example, for \fBwish\fR
the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR
for Windows.
.TP
\fBtcl_traceCompile\fR
.
The value of this variable can be set to control
how much tracing information
is displayed during bytecode compilation.
By default, \fBtcl_traceCompile\fR is zero and no information is displayed.
Setting \fBtcl_traceCompile\fR to 1 generates a one-line summary in \fBstdout\fR






|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
352
353
354
355
356
357
358
































































359
360
361
362
363
364
365
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH tclvars n 8.0 Tcl "Tcl Built-In Commands"
.so man.macros
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_library, tcl_nonwordchars, tcl_patchLevel, tcl_pkgPath, tcl_platform, tcl_rcFileName, tcl_traceCompile, tcl_traceExec, tcl_wordchars, tcl_version \- Variables used by Tcl
.BE
.SH DESCRIPTION
.PP
The following global variables are created and managed automatically
by the Tcl library.  Except where noted below, these variables should
normally be treated as read-only by application-specific code and by users.
.TP
................................................................................
.TP
\fBwordSize\fR
.
This gives the size of the native-machine word in bytes (strictly, it
is same as the result of evaluating \fIsizeof(long)\fR in C.)
.RE
.TP
































































\fBtcl_traceCompile\fR
.
The value of this variable can be set to control
how much tracing information
is displayed during bytecode compilation.
By default, \fBtcl_traceCompile\fR is zero and no information is displayed.
Setting \fBtcl_traceCompile\fR to 1 generates a one-line summary in \fBstdout\fR

Changes to generic/tcl.h.

944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
#ifndef TCL_NO_DEPRECATED
#   define Tcl_DStringTrunc Tcl_DStringSetLength
#endif /* !TCL_NO_DEPRECATED */

/*
 * Definitions for the maximum number of digits of precision that may be
 * specified in the "tcl_precision" variable, and the number of bytes of
 * buffer space required by Tcl_PrintDouble.
 */

#define TCL_MAX_PREC		17
#define TCL_DOUBLE_SPACE	(TCL_MAX_PREC+10)

/*
 * Definition for a number of bytes of buffer space sufficient to hold the






|
|







944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
#define Tcl_DStringValue(dsPtr) ((dsPtr)->string)
#ifndef TCL_NO_DEPRECATED
#   define Tcl_DStringTrunc Tcl_DStringSetLength
#endif /* !TCL_NO_DEPRECATED */

/*
 * Definitions for the maximum number of digits of precision that may be
 * produced by Tcl_PrintDouble, and the number of bytes of buffer space
 * required by Tcl_PrintDouble.
 */

#define TCL_MAX_PREC		17
#define TCL_DOUBLE_SPACE	(TCL_MAX_PREC+10)

/*
 * Definition for a number of bytes of buffer space sufficient to hold the

Changes to generic/tclBasic.c.

933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
    /*
     * Set up other variables such as tcl_version and tcl_library
     */

    Tcl_SetVar2(interp, "tcl_patchLevel", NULL, TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY);
    Tcl_SetVar2(interp, "tcl_version", NULL, TCL_VERSION, TCL_GLOBAL_ONLY);
    Tcl_TraceVar2(interp, "tcl_precision", NULL,
	    TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
	    TclPrecTraceProc, NULL);
    TclpSetVariables(interp);

#ifdef TCL_THREADS
    /*
     * The existence of the "threaded" element of the tcl_platform array
     * indicates that this particular Tcl shell has been compiled with threads
     * turned on. Using "info exists tcl_platform(threaded)" a Tcl script can






<
<
<







933
934
935
936
937
938
939



940
941
942
943
944
945
946
    /*
     * Set up other variables such as tcl_version and tcl_library
     */

    Tcl_SetVar2(interp, "tcl_patchLevel", NULL, TCL_PATCH_LEVEL, TCL_GLOBAL_ONLY);
    Tcl_SetVar2(interp, "tcl_version", NULL, TCL_VERSION, TCL_GLOBAL_ONLY);



    TclpSetVariables(interp);

#ifdef TCL_THREADS
    /*
     * The existence of the "threaded" element of the tcl_platform array
     * indicates that this particular Tcl shell has been compiled with threads
     * turned on. Using "info exists tcl_platform(threaded)" a Tcl script can

Changes to generic/tclInt.decls.

354
355
356
357
358
359
360

361
362
363
364

365
366
367
368
369
370
371
#  declare 86 {
#      int TclParseQuotes(Tcl_Interp *interp, char *str, int termChar,
#  	    int flags, char **termPtr, ParseValue *pvPtr)
#  }
#  declare 87 {
#      void TclPlatformInit(Tcl_Interp *interp)
#  }

declare 88 {
    char *TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp,
	    const char *name1, const char *name2, int flags)
}

declare 89 {
    int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp,
	    Tcl_Command cmd)
}
# Removed in 8.1 (only available if compiled with TCL_COMPILE_DEBUG):
#  declare 90 {
#      void TclPrintByteCodeObj(Tcl_Interp *interp, Tcl_Obj *objPtr)






>
|
|
|
<
>







354
355
356
357
358
359
360
361
362
363
364

365
366
367
368
369
370
371
372
#  declare 86 {
#      int TclParseQuotes(Tcl_Interp *interp, char *str, int termChar,
#  	    int flags, char **termPtr, ParseValue *pvPtr)
#  }
#  declare 87 {
#      void TclPlatformInit(Tcl_Interp *interp)
#  }
# Removed in 9.0:
#declare 88 {
#    char *TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp,
#	    const char *name1, const char *name2, int flags)

#}
declare 89 {
    int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp,
	    Tcl_Command cmd)
}
# Removed in 8.1 (only available if compiled with TCL_COMPILE_DEBUG):
#  declare 90 {
#      void TclPrintByteCodeObj(Tcl_Interp *interp, Tcl_Obj *objPtr)

Changes to generic/tclIntDecls.h.

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
...
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
...
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
EXTERN char *		TclpRealloc(char *ptr, unsigned int size);
/* Slot 82 is reserved */
/* Slot 83 is reserved */
/* Slot 84 is reserved */
/* Slot 85 is reserved */
/* Slot 86 is reserved */
/* Slot 87 is reserved */
/* 88 */
EXTERN char *		TclPrecTraceProc(ClientData clientData,
				Tcl_Interp *interp, const char *name1,
				const char *name2, int flags);
/* 89 */
EXTERN int		TclPreventAliasLoop(Tcl_Interp *interp,
				Tcl_Interp *cmdInterp, Tcl_Command cmd);
/* Slot 90 is reserved */
/* 91 */
EXTERN void		TclProcCleanupProc(Proc *procPtr);
/* 92 */
................................................................................
    char * (*tclpRealloc) (char *ptr, unsigned int size); /* 81 */
    void (*reserved82)(void);
    void (*reserved83)(void);
    void (*reserved84)(void);
    void (*reserved85)(void);
    void (*reserved86)(void);
    void (*reserved87)(void);
    char * (*tclPrecTraceProc) (ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); /* 88 */
    int (*tclPreventAliasLoop) (Tcl_Interp *interp, Tcl_Interp *cmdInterp, Tcl_Command cmd); /* 89 */
    void (*reserved90)(void);
    void (*tclProcCleanupProc) (Proc *procPtr); /* 91 */
    int (*tclProcCompileProc) (Tcl_Interp *interp, Proc *procPtr, Tcl_Obj *bodyPtr, Namespace *nsPtr, const char *description, const char *procName); /* 92 */
    void (*tclProcDeleteProc) (ClientData clientData); /* 93 */
    void (*reserved94)(void);
    void (*reserved95)(void);
................................................................................
	(tclIntStubsPtr->tclpRealloc) /* 81 */
/* Slot 82 is reserved */
/* Slot 83 is reserved */
/* Slot 84 is reserved */
/* Slot 85 is reserved */
/* Slot 86 is reserved */
/* Slot 87 is reserved */
#define TclPrecTraceProc \
	(tclIntStubsPtr->tclPrecTraceProc) /* 88 */
#define TclPreventAliasLoop \
	(tclIntStubsPtr->tclPreventAliasLoop) /* 89 */
/* Slot 90 is reserved */
#define TclProcCleanupProc \
	(tclIntStubsPtr->tclProcCleanupProc) /* 91 */
#define TclProcCompileProc \
	(tclIntStubsPtr->tclProcCompileProc) /* 92 */






|
<
<
<







 







|







 







|
<







206
207
208
209
210
211
212
213



214
215
216
217
218
219
220
...
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
...
984
985
986
987
988
989
990
991

992
993
994
995
996
997
998
EXTERN char *		TclpRealloc(char *ptr, unsigned int size);
/* Slot 82 is reserved */
/* Slot 83 is reserved */
/* Slot 84 is reserved */
/* Slot 85 is reserved */
/* Slot 86 is reserved */
/* Slot 87 is reserved */
/* Slot 88 is reserved */



/* 89 */
EXTERN int		TclPreventAliasLoop(Tcl_Interp *interp,
				Tcl_Interp *cmdInterp, Tcl_Command cmd);
/* Slot 90 is reserved */
/* 91 */
EXTERN void		TclProcCleanupProc(Proc *procPtr);
/* 92 */
................................................................................
    char * (*tclpRealloc) (char *ptr, unsigned int size); /* 81 */
    void (*reserved82)(void);
    void (*reserved83)(void);
    void (*reserved84)(void);
    void (*reserved85)(void);
    void (*reserved86)(void);
    void (*reserved87)(void);
    void (*reserved88)(void);
    int (*tclPreventAliasLoop) (Tcl_Interp *interp, Tcl_Interp *cmdInterp, Tcl_Command cmd); /* 89 */
    void (*reserved90)(void);
    void (*tclProcCleanupProc) (Proc *procPtr); /* 91 */
    int (*tclProcCompileProc) (Tcl_Interp *interp, Proc *procPtr, Tcl_Obj *bodyPtr, Namespace *nsPtr, const char *description, const char *procName); /* 92 */
    void (*tclProcDeleteProc) (ClientData clientData); /* 93 */
    void (*reserved94)(void);
    void (*reserved95)(void);
................................................................................
	(tclIntStubsPtr->tclpRealloc) /* 81 */
/* Slot 82 is reserved */
/* Slot 83 is reserved */
/* Slot 84 is reserved */
/* Slot 85 is reserved */
/* Slot 86 is reserved */
/* Slot 87 is reserved */
/* Slot 88 is reserved */

#define TclPreventAliasLoop \
	(tclIntStubsPtr->tclPreventAliasLoop) /* 89 */
/* Slot 90 is reserved */
#define TclProcCleanupProc \
	(tclIntStubsPtr->tclProcCleanupProc) /* 91 */
#define TclProcCompileProc \
	(tclIntStubsPtr->tclProcCompileProc) /* 92 */

Changes to generic/tclListObj.c.

980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
	    listRepPtr = AttemptNewList(NULL, numRequired + growth, NULL);
	    if (listRepPtr == NULL) {
		listRepPtr = AttemptNewList(interp, numRequired, NULL);
		if (listRepPtr == NULL) {
		    for (i = 0;  i < objc;  i++) {
			/* See bug 3598580 */
#if TCL_MAJOR_VERSION > 8
			Tcl_DecrRefCount(objv[i]);
#else
			objv[i]->refCount--;
#endif
		    }
		    return TCL_ERROR;
		}
	    }
	}

	listPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;






<

<
<
<







980
981
982
983
984
985
986

987



988
989
990
991
992
993
994
	    listRepPtr = AttemptNewList(NULL, numRequired + growth, NULL);
	    if (listRepPtr == NULL) {
		listRepPtr = AttemptNewList(interp, numRequired, NULL);
		if (listRepPtr == NULL) {
		    for (i = 0;  i < objc;  i++) {
			/* See bug 3598580 */

			Tcl_DecrRefCount(objv[i]);



		    }
		    return TCL_ERROR;
		}
	    }
	}

	listPtr->internalRep.twoPtrValue.ptr1 = listRepPtr;

Changes to generic/tclObj.c.

2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
 
/*
 *----------------------------------------------------------------------
 *
 * UpdateStringOfDouble --
 *
 *	Update the string representation for a double-precision floating point
 *	object. This must obey the current tcl_precision value for
 *	double-to-string conversions. Note: This function does not free an
 *	existing old string rep so storage will be lost if this has not
 *	already been done.
 *
 * Results:
 *	None.
 *
 * Side effects:






<
|







2345
2346
2347
2348
2349
2350
2351

2352
2353
2354
2355
2356
2357
2358
2359
 
/*
 *----------------------------------------------------------------------
 *
 * UpdateStringOfDouble --
 *
 *	Update the string representation for a double-precision floating point

 *	object. Note: This function does not free an
 *	existing old string rep so storage will be lost if this has not
 *	already been done.
 *
 * Results:
 *	None.
 *
 * Side effects:

Changes to generic/tclStrToD.c.

3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
....
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
 *	endPtr to point to the terminating '\0' byte of the string. Sets *sign
 *	to 1 if a minus sign should be printed with the number, or 0 if a plus
 *	sign (or no sign) should appear.
 *
 * This function is a service routine that produces the string of digits for
 * floating-point-to-decimal conversion. It can do a number of things
 * according to the 'flags' argument. Valid values for 'flags' include:
 *	TCL_DD_SHORTEST - This is the default for floating point conversion if
 *		::tcl_precision is 0. It constructs the shortest string of
 *		digits that will reconvert to the given number when scanned.
 *		For floating point numbers that are exactly between two
 *		decimal numbers, it resolves using the 'round to even' rule.
 *		With this value, the 'ndigits' parameter is ignored.
 *	TCL_DD_STEELE - This value is not recommended and may be removed in
 *		the future. It follows the conversion algorithm outlined in
 *		"How to Print Floating-Point Numbers Accurately" by Guy
................................................................................
 *		L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90,
 *		pp. 112-126]. This rule has the effect of rendering 1e23 as
 *		9.9999999999999999e22 - which is a 'better' approximation in
 *		the sense that it will reconvert correctly even if a
 *		subsequent input conversion is 'round up' or 'round down'
 *		rather than 'round to nearest', but is surprising otherwise.
 *	TCL_DD_E_FORMAT - This value is used to prepare numbers for %e format
 *		conversion (or for default floating->string if tcl_precision
 *		is not 0). It constructs a string of at most 'ndigits' digits,
 *		choosing the one that is closest to the given number (and
 *		resolving ties with 'round to even').  It is allowed to return
 *		fewer than 'ndigits' if the number converts exactly; if the
 *		TCL_DD_E_FORMAT|TCL_DD_SHORTEN_FLAG is supplied instead, it
 *		also returns fewer digits if the shorter string will still
 *		reconvert without loss to the given input number. In any case,
 *		strings of trailing zeroes are suppressed.






|
|







 







<
|







3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
....
4008
4009
4010
4011
4012
4013
4014

4015
4016
4017
4018
4019
4020
4021
4022
 *	endPtr to point to the terminating '\0' byte of the string. Sets *sign
 *	to 1 if a minus sign should be printed with the number, or 0 if a plus
 *	sign (or no sign) should appear.
 *
 * This function is a service routine that produces the string of digits for
 * floating-point-to-decimal conversion. It can do a number of things
 * according to the 'flags' argument. Valid values for 'flags' include:
 *	TCL_DD_SHORTEST - This is the default for floating point conversion.
 *		It constructs the shortest string of
 *		digits that will reconvert to the given number when scanned.
 *		For floating point numbers that are exactly between two
 *		decimal numbers, it resolves using the 'round to even' rule.
 *		With this value, the 'ndigits' parameter is ignored.
 *	TCL_DD_STEELE - This value is not recommended and may be removed in
 *		the future. It follows the conversion algorithm outlined in
 *		"How to Print Floating-Point Numbers Accurately" by Guy
................................................................................
 *		L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90,
 *		pp. 112-126]. This rule has the effect of rendering 1e23 as
 *		9.9999999999999999e22 - which is a 'better' approximation in
 *		the sense that it will reconvert correctly even if a
 *		subsequent input conversion is 'round up' or 'round down'
 *		rather than 'round to nearest', but is surprising otherwise.
 *	TCL_DD_E_FORMAT - This value is used to prepare numbers for %e format

 *		conversion. It constructs a string of at most 'ndigits' digits,
 *		choosing the one that is closest to the given number (and
 *		resolving ties with 'round to even').  It is allowed to return
 *		fewer than 'ndigits' if the number converts exactly; if the
 *		TCL_DD_E_FORMAT|TCL_DD_SHORTEN_FLAG is supplied instead, it
 *		also returns fewer digits if the shorter string will still
 *		reconvert without loss to the given input number. In any case,
 *		strings of trailing zeroes are suppressed.

Changes to generic/tclStubInit.c.

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
...
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
...
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
#undef Tcl_CreateHashEntry
#undef Tcl_Panic
#undef Tcl_FindExecutable
#undef TclpGetPid
#undef TclSockMinimumBuffers
#undef Tcl_SetIntObj

#if defined(TCL_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8
#   define TclBNInitBignumFromWideUInt 0
#   define TclBNInitBignumFromWideInt 0
#   define TclBNInitBignumFromLong 0
#else
#   define TclBNInitBignumFromWideUInt TclInitBignumFromWideUInt
#   define TclBNInitBignumFromWideInt TclInitBignumFromWideInt
#   define TclBNInitBignumFromLong TclInitBignumFromLong
#endif /* TCL_NO_DEPRECATED */

#ifdef _WIN32
#   define TclUnixWaitForFile 0
#   define TclUnixCopyFile 0
#   define TclUnixOpenTemporaryFile 0
#   define TclpIsAtty 0
#elif defined(__CYGWIN__)
#   define TclpIsAtty TclPlatIsAtty
................................................................................
    TclpRealloc, /* 81 */
    0, /* 82 */
    0, /* 83 */
    0, /* 84 */
    0, /* 85 */
    0, /* 86 */
    0, /* 87 */
    TclPrecTraceProc, /* 88 */
    TclPreventAliasLoop, /* 89 */
    0, /* 90 */
    TclProcCleanupProc, /* 91 */
    TclProcCompileProc, /* 92 */
    TclProcDeleteProc, /* 93 */
    0, /* 94 */
    0, /* 95 */
................................................................................
    TclBN_s_mp_add, /* 57 */
    TclBN_s_mp_mul_digs, /* 58 */
    TclBN_s_mp_sqr, /* 59 */
    TclBN_s_mp_sub, /* 60 */
    TclBN_mp_init_set_int, /* 61 */
    TclBN_mp_set_int, /* 62 */
    TclBN_mp_cnt_lsb, /* 63 */
    TclBNInitBignumFromLong, /* 64 */
    TclBNInitBignumFromWideInt, /* 65 */
    TclBNInitBignumFromWideUInt, /* 66 */
    TclBN_mp_expt_d_ex, /* 67 */
    TclBN_mp_set_long_long, /* 68 */
    TclBN_mp_get_long_long, /* 69 */
    TclBN_mp_set_long, /* 70 */
    TclBN_mp_get_long, /* 71 */
};







<
<
<
<
<
<
<
<
<
<







 







|







 







|
|
|







39
40
41
42
43
44
45










46
47
48
49
50
51
52
...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
...
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
#undef Tcl_CreateHashEntry
#undef Tcl_Panic
#undef Tcl_FindExecutable
#undef TclpGetPid
#undef TclSockMinimumBuffers
#undef Tcl_SetIntObj











#ifdef _WIN32
#   define TclUnixWaitForFile 0
#   define TclUnixCopyFile 0
#   define TclUnixOpenTemporaryFile 0
#   define TclpIsAtty 0
#elif defined(__CYGWIN__)
#   define TclpIsAtty TclPlatIsAtty
................................................................................
    TclpRealloc, /* 81 */
    0, /* 82 */
    0, /* 83 */
    0, /* 84 */
    0, /* 85 */
    0, /* 86 */
    0, /* 87 */
    0, /* 88 */
    TclPreventAliasLoop, /* 89 */
    0, /* 90 */
    TclProcCleanupProc, /* 91 */
    TclProcCompileProc, /* 92 */
    TclProcDeleteProc, /* 93 */
    0, /* 94 */
    0, /* 95 */
................................................................................
    TclBN_s_mp_add, /* 57 */
    TclBN_s_mp_mul_digs, /* 58 */
    TclBN_s_mp_sqr, /* 59 */
    TclBN_s_mp_sub, /* 60 */
    TclBN_mp_init_set_int, /* 61 */
    TclBN_mp_set_int, /* 62 */
    TclBN_mp_cnt_lsb, /* 63 */
    0, /* 64 */
    0, /* 65 */
    0, /* 66 */
    TclBN_mp_expt_d_ex, /* 67 */
    TclBN_mp_set_long_long, /* 68 */
    TclBN_mp_get_long_long, /* 69 */
    TclBN_mp_set_long, /* 70 */
    TclBN_mp_get_long, /* 71 */
};

Changes to generic/tclTomMath.decls.

219
220
221
222
223
224
225
226

227
228
229



230
231
232



233
234

235
236
237
238
239
240
241
}
declare 63 {
    int TclBN_mp_cnt_lsb(const mp_int *a)
}

# Formerly internal API to allow initialisation of bignums without knowing the
# typedefs of how a bignum works internally.
declare 64 {deprecated {Use mp_init() + mp_set_long_long()}} {

    void TclBNInitBignumFromLong(mp_int *bignum, long initVal)
}
declare 65 {deprecated {Use mp_init() + mp_set_long_long()}} {



    void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal)
}
declare 66 {deprecated {Use mp_init() + mp_set_long_long()}} {



    void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal)
}


# Added in libtommath 1.0
declare 67 {
    int TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast)
}
# Added in libtommath 1.0.1
declare 68 {






|
>
|
<
<
>
>
>
|
<
<
>
>
>
|
<
>







219
220
221
222
223
224
225
226
227
228


229
230
231
232


233
234
235
236

237
238
239
240
241
242
243
244
}
declare 63 {
    int TclBN_mp_cnt_lsb(const mp_int *a)
}

# Formerly internal API to allow initialisation of bignums without knowing the
# typedefs of how a bignum works internally.
# Removed in 9.0
#declare 64 {
#    void TclBNInitBignumFromLong(mp_int *bignum, long initVal)


#}
# Removed in 9.0
#declare 65 {
#    void TclBNInitBignumFromWideInt(mp_int *bignum, Tcl_WideInt initVal)


#}
# Removed in 9.0
#declare 66 {
#    void TclBNInitBignumFromWideUInt(mp_int *bignum, Tcl_WideUInt initVal)

#}

# Added in libtommath 1.0
declare 67 {
    int TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast)
}
# Added in libtommath 1.0.1
declare 68 {

Changes to generic/tclTomMathDecls.h.

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
...
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
...
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
				mp_int *c);
/* 61 */
EXTERN int		TclBN_mp_init_set_int(mp_int *a, unsigned long i);
/* 62 */
EXTERN int		TclBN_mp_set_int(mp_int *a, unsigned long i);
/* 63 */
EXTERN int		TclBN_mp_cnt_lsb(const mp_int *a);
/* 64 */
TCL_DEPRECATED("Use mp_init() + mp_set_long_long()")
void			TclBNInitBignumFromLong(mp_int *bignum, long initVal);
/* 65 */
TCL_DEPRECATED("Use mp_init() + mp_set_long_long()")
void			TclBNInitBignumFromWideInt(mp_int *bignum,
				Tcl_WideInt initVal);
/* 66 */
TCL_DEPRECATED("Use mp_init() + mp_set_long_long()")
void			TclBNInitBignumFromWideUInt(mp_int *bignum,
				Tcl_WideUInt initVal);
/* 67 */
EXTERN int		TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b,
				mp_int *c, int fast);
/* 68 */
EXTERN int		TclBN_mp_set_long_long(mp_int *a, Tcl_WideUInt i);
/* 69 */
EXTERN Tcl_WideUInt	TclBN_mp_get_long_long(const mp_int *a);
................................................................................
    int (*tclBN_s_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 57 */
    int (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
    int (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
    int (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
    int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
    int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
    int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
    TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */
    TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */
    TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */
    int (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
    int (*tclBN_mp_set_long_long) (mp_int *a, Tcl_WideUInt i); /* 68 */
    Tcl_WideUInt (*tclBN_mp_get_long_long) (const mp_int *a); /* 69 */
    int (*tclBN_mp_set_long) (mp_int *a, unsigned long i); /* 70 */
    unsigned long (*tclBN_mp_get_long) (const mp_int *a); /* 71 */
} TclTomMathStubs;

................................................................................
	(tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
#define TclBN_mp_init_set_int \
	(tclTomMathStubsPtr->tclBN_mp_init_set_int) /* 61 */
#define TclBN_mp_set_int \
	(tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
#define TclBN_mp_cnt_lsb \
	(tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
#define TclBNInitBignumFromLong \
	(tclTomMathStubsPtr->tclBNInitBignumFromLong) /* 64 */
#define TclBNInitBignumFromWideInt \
	(tclTomMathStubsPtr->tclBNInitBignumFromWideInt) /* 65 */
#define TclBNInitBignumFromWideUInt \
	(tclTomMathStubsPtr->tclBNInitBignumFromWideUInt) /* 66 */
#define TclBN_mp_expt_d_ex \
	(tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
#define TclBN_mp_set_long_long \
	(tclTomMathStubsPtr->tclBN_mp_set_long_long) /* 68 */
#define TclBN_mp_get_long_long \
	(tclTomMathStubsPtr->tclBN_mp_get_long_long) /* 69 */
#define TclBN_mp_set_long \






|
|
|
<
<
<
<
<
<
<
<







 







|
|
|







 







|
|
|
<
<
<







298
299
300
301
302
303
304
305
306
307








308
309
310
311
312
313
314
...
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
...
531
532
533
534
535
536
537
538
539
540



541
542
543
544
545
546
547
				mp_int *c);
/* 61 */
EXTERN int		TclBN_mp_init_set_int(mp_int *a, unsigned long i);
/* 62 */
EXTERN int		TclBN_mp_set_int(mp_int *a, unsigned long i);
/* 63 */
EXTERN int		TclBN_mp_cnt_lsb(const mp_int *a);
/* Slot 64 is reserved */
/* Slot 65 is reserved */
/* Slot 66 is reserved */








/* 67 */
EXTERN int		TclBN_mp_expt_d_ex(const mp_int *a, mp_digit b,
				mp_int *c, int fast);
/* 68 */
EXTERN int		TclBN_mp_set_long_long(mp_int *a, Tcl_WideUInt i);
/* 69 */
EXTERN Tcl_WideUInt	TclBN_mp_get_long_long(const mp_int *a);
................................................................................
    int (*tclBN_s_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 57 */
    int (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
    int (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
    int (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
    int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
    int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
    int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
    void (*reserved64)(void);
    void (*reserved65)(void);
    void (*reserved66)(void);
    int (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
    int (*tclBN_mp_set_long_long) (mp_int *a, Tcl_WideUInt i); /* 68 */
    Tcl_WideUInt (*tclBN_mp_get_long_long) (const mp_int *a); /* 69 */
    int (*tclBN_mp_set_long) (mp_int *a, unsigned long i); /* 70 */
    unsigned long (*tclBN_mp_get_long) (const mp_int *a); /* 71 */
} TclTomMathStubs;

................................................................................
	(tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
#define TclBN_mp_init_set_int \
	(tclTomMathStubsPtr->tclBN_mp_init_set_int) /* 61 */
#define TclBN_mp_set_int \
	(tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
#define TclBN_mp_cnt_lsb \
	(tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
/* Slot 64 is reserved */
/* Slot 65 is reserved */
/* Slot 66 is reserved */



#define TclBN_mp_expt_d_ex \
	(tclTomMathStubsPtr->tclBN_mp_expt_d_ex) /* 67 */
#define TclBN_mp_set_long_long \
	(tclTomMathStubsPtr->tclBN_mp_set_long_long) /* 68 */
#define TclBN_mp_get_long_long \
	(tclTomMathStubsPtr->tclBN_mp_get_long_long) /* 69 */
#define TclBN_mp_set_long \

Changes to generic/tclTomMathInterface.c.

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
	mp_set_long_long(a, (Tcl_WideUInt)v);
    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclBNInitBignumFromWideInt --
 *
 *	Allocate and initialize a 'bignum' from a Tcl_WideInt
 *
 * Results:
 *	None.
 *
 * Side effects:
................................................................................
	mp_set_long_long(a, (Tcl_WideUInt)v);
    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclBNInitBignumFromWideUInt --
 *
 *	Allocate and initialize a 'bignum' from a Tcl_WideUInt
 *
 * Results:
 *	None.
 *
 * Side effects:






|







 







|







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
	mp_set_long_long(a, (Tcl_WideUInt)v);
    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclInitBignumFromWideInt --
 *
 *	Allocate and initialize a 'bignum' from a Tcl_WideInt
 *
 * Results:
 *	None.
 *
 * Side effects:
................................................................................
	mp_set_long_long(a, (Tcl_WideUInt)v);
    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclInitBignumFromWideUInt --
 *
 *	Allocate and initialize a 'bignum' from a Tcl_WideUInt
 *
 * Results:
 *	None.
 *
 * Side effects:

Changes to generic/tclUtil.c.

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
....
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
....
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
....
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
....
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
#define COMPAT 1
#define CONVERT_NONE	0
#define CONVERT_BRACE	2
#define CONVERT_ESCAPE	4
#define CONVERT_MASK	(CONVERT_BRACE | CONVERT_ESCAPE)
#define CONVERT_ANY	16

/*
 * The following key is used by Tcl_PrintDouble and TclPrecTraceProc to
 * access the precision to be used for double formatting.
 */

static Tcl_ThreadDataKey precisionKey;

/*
 * Prototypes for functions defined later in this file.
 */

static void		ClearHash(Tcl_HashTable *tablePtr);
static void		FreeProcessGlobalValue(ClientData clientData);
static void		FreeThreadHash(ClientData clientData);
................................................................................
 *
 * Tcl_PrintDouble --
 *
 *	Given a floating-point value, this function converts it to an ASCII
 *	string using.
 *
 * Results:
 *	The ASCII equivalent of "value" is written at "dst". It is written
 *	using the current precision, and it is guaranteed to contain a decimal
 *	point or exponent, so that it looks like a floating-point value and
 *	not an integer.
 *
 * Side effects:
 *	None.
 *
 *----------------------------------------------------------------------
 */

void
Tcl_PrintDouble(
    Tcl_Interp *interp,		/* Interpreter whose tcl_precision variable
				 * used to be used to control printing. It's
				 * ignored now. */
    double value,		/* Value to print as string. */
    char *dst)			/* Where to store converted value; must have
				 * at least TCL_DOUBLE_SPACE characters. */
{
    char *p, c;
    int exponent;
    int signum;
    char *digits;
    char *end;
    int *precisionPtr = Tcl_GetThreadData(&precisionKey, sizeof(int));

    /*
     * Handle NaN.
     */

    if (TclIsNaN(value)) {
	TclFormatNaN(value, dst);
................................................................................
	return;
    }

    /*
     * Ordinary (normal and denormal) values.
     */

    if (*precisionPtr == 0) {
	digits = TclDoubleDigits(value, -1, TCL_DD_SHORTEST,
		&exponent, &signum, &end);
    } else {
	/*
	 * There are at least two possible interpretations for tcl_precision.
	 *
	 * The first is, "choose the decimal representation having
	 * $tcl_precision digits of significance that is nearest to the given
	 * number, breaking ties by rounding to even, and then trimming
	 * trailing zeros." This gives the greatest possible precision in the
	 * decimal string, but offers the anomaly that [expr 0.1] will be
	 * "0.10000000000000001".
	 *
	 * The second is "choose the decimal representation having at most
	 * $tcl_precision digits of significance that is nearest to the given
	 * number. If no such representation converts exactly to the given
	 * number, choose the one that is closest, breaking ties by rounding
	 * to even. If more than one such representation converts exactly to
	 * the given number, choose the shortest, breaking ties in favour of
	 * the nearest, breaking remaining ties in favour of the one ending in
	 * an even digit."
	 *
	 * Tcl 8.4 implements the first of these, which gives rise to
	 * anomalies in formatting:
	 *
	 *	% expr 0.1
	 *	0.10000000000000001
	 *	% expr 0.01
	 *	0.01
	 *	% expr 1e-7
	 *	9.9999999999999995e-08
	 *
	 * For human readability, it appears better to choose the second rule,
	 * and let [expr 0.1] return 0.1. But for 8.4 compatibility, we prefer
	 * the first (the recommended zero value for tcl_precision avoids the
	 * problem entirely).
	 *
	 * Uncomment TCL_DD_SHORTEN_FLAG in the next call to prefer the method
	 * that allows floating point values to be shortened if it can be done
	 * without loss of precision.
	 */

	digits = TclDoubleDigits(value, *precisionPtr,
		TCL_DD_E_FORMAT /* | TCL_DD_SHORTEN_FLAG */,
		&exponent, &signum, &end);
    }
    if (signum) {
	*dst++ = '-';
    }
    p = digits;
    if (exponent < -4 || exponent > 16) {
	/*
	 * E format for numbers < 1e-3 or >= 1e17.
................................................................................
	    *dst++ = '.';
	    while (c != '\0') {
		*dst++ = c;
		c = *++p;
	    }
	}

	/*
	 * Tcl 8.4 appears to format with at least a two-digit exponent;
	 * preserve that behaviour when tcl_precision != 0
	 */

	if (*precisionPtr == 0) {
	    sprintf(dst, "e%+d", exponent);
	} else {
	    sprintf(dst, "e%+03d", exponent);
	}
    } else {
	/*
	 * F format for others.
	 */

	if (exponent < 0) {
	    *dst++ = '0';
................................................................................
		c = *++p;
	    }
	}
	*dst++ = '\0';
    }
    ckfree(digits);
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclPrecTraceProc --
 *
 *	This function is invoked whenever the variable "tcl_precision" is
 *	written.
 *
 * Results:
 *	Returns NULL if all went well, or an error message if the new value
 *	for the variable doesn't make sense.
 *
 * Side effects:
 *	If the new value doesn't make sense then this function undoes the
 *	effect of the variable modification. Otherwise it modifies the format
 *	string that's used by Tcl_PrintDouble.
 *
 *----------------------------------------------------------------------
 */

	/* ARGSUSED */
char *
TclPrecTraceProc(
    ClientData clientData,	/* Not used. */
    Tcl_Interp *interp,		/* Interpreter containing variable. */
    const char *name1,		/* Name of variable. */
    const char *name2,		/* Second part of variable name. */
    int flags)			/* Information about what happened. */
{
    Tcl_Obj *value;
    int prec;
    int *precisionPtr = Tcl_GetThreadData(&precisionKey, sizeof(int));

    /*
     * If the variable is unset, then recreate the trace.
     */

    if (flags & TCL_TRACE_UNSETS) {
	if ((flags & TCL_TRACE_DESTROYED) && !Tcl_InterpDeleted(interp)) {
	    Tcl_TraceVar2(interp, name1, name2,
		    TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES
		    |TCL_TRACE_UNSETS, TclPrecTraceProc, clientData);
	}
	return NULL;
    }

    /*
     * When the variable is read, reset its value from our shared value. This
     * is needed in case the variable was modified in some other interpreter
     * so that this interpreter's value is out of date.
     */


    if (flags & TCL_TRACE_READS) {
	Tcl_SetVar2Ex(interp, name1, name2, Tcl_NewIntObj(*precisionPtr),
		flags & TCL_GLOBAL_ONLY);
	return NULL;
    }

    /*
     * The variable is being written. Check the new value and disallow it if
     * it isn't reasonable or if this is a safe interpreter (we don't want
     * safe interpreters messing up the precision of other interpreters).
     */

    if (Tcl_IsSafe(interp)) {
	return (char *) "can't modify precision from a safe interpreter";
    }
    value = Tcl_GetVar2Ex(interp, name1, name2, flags & TCL_GLOBAL_ONLY);
    if (value == NULL
	    || Tcl_GetIntFromObj(NULL, value, &prec) != TCL_OK
	    || prec < 0 || prec > TCL_MAX_PREC) {
	return (char *) "improper value for precision";
    }
    *precisionPtr = prec;
    return NULL;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclNeedSpace --
 *
 *	This function checks to see whether it is appropriate to add a space






<
<
<
<
<
<
<







 







|
|
|
<









|
<
<









<







 







<
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
|
<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







89
90
91
92
93
94
95







96
97
98
99
100
101
102
....
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035

3036
3037
3038
3039
3040
3041
3042
3043
3044
3045


3046
3047
3048
3049
3050
3051
3052
3053
3054

3055
3056
3057
3058
3059
3060
3061
....
3079
3080
3081
3082
3083
3084
3085

3086
3087












































3088
3089
3090
3091
3092
3093
3094
....
3100
3101
3102
3103
3104
3105
3106






3107



3108
3109
3110
3111
3112
3113
3114
....
3134
3135
3136
3137
3138
3139
3140














































































3141
3142
3143
3144
3145
3146
3147
#define COMPAT 1
#define CONVERT_NONE	0
#define CONVERT_BRACE	2
#define CONVERT_ESCAPE	4
#define CONVERT_MASK	(CONVERT_BRACE | CONVERT_ESCAPE)
#define CONVERT_ANY	16








/*
 * Prototypes for functions defined later in this file.
 */

static void		ClearHash(Tcl_HashTable *tablePtr);
static void		FreeProcessGlobalValue(ClientData clientData);
static void		FreeThreadHash(ClientData clientData);
................................................................................
 *
 * Tcl_PrintDouble --
 *
 *	Given a floating-point value, this function converts it to an ASCII
 *	string using.
 *
 * Results:
 *	The ASCII equivalent of "value" is written at "dst". It is guaranteed
 *	to contain a decimal point or exponent, so that it looks like a
 *	floating-point value and not an integer.

 *
 * Side effects:
 *	None.
 *
 *----------------------------------------------------------------------
 */

void
Tcl_PrintDouble(
    Tcl_Interp *interp,		/* Not used */


    double value,		/* Value to print as string. */
    char *dst)			/* Where to store converted value; must have
				 * at least TCL_DOUBLE_SPACE characters. */
{
    char *p, c;
    int exponent;
    int signum;
    char *digits;
    char *end;


    /*
     * Handle NaN.
     */

    if (TclIsNaN(value)) {
	TclFormatNaN(value, dst);
................................................................................
	return;
    }

    /*
     * Ordinary (normal and denormal) values.
     */


    digits = TclDoubleDigits(value, -1, TCL_DD_SHORTEST,
	    &exponent, &signum, &end);












































    if (signum) {
	*dst++ = '-';
    }
    p = digits;
    if (exponent < -4 || exponent > 16) {
	/*
	 * E format for numbers < 1e-3 or >= 1e17.
................................................................................
	    *dst++ = '.';
	    while (c != '\0') {
		*dst++ = c;
		c = *++p;
	    }
	}







	sprintf(dst, "e%+d", exponent);



    } else {
	/*
	 * F format for others.
	 */

	if (exponent < 0) {
	    *dst++ = '0';
................................................................................
		c = *++p;
	    }
	}
	*dst++ = '\0';
    }
    ckfree(digits);
}














































































 
/*
 *----------------------------------------------------------------------
 *
 * TclNeedSpace --
 *
 *	This function checks to see whether it is appropriate to add a space

Changes to tests/basic.test.

889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
        set leak [expr {$end - $tmp}]
    } -cleanup {
	unset end i tmp
	rename getbytes {}
	rename stress {}
} -result 0

test basic-48.17.$noComp {expansion: object safety} -setup {
        set old_precision $::tcl_precision
        set ::tcl_precision 4
    } -constraints $constraints -body {
            set third [expr {1.0/3.0}]
            set l [list $third $third]
            set x [run {list $third {*}$l $third}]
	    set res [list]
            foreach t $x {
                lappend res [expr {$t * 3.0}]
            }
            set res
    } -cleanup {
        set ::tcl_precision $old_precision
        unset old_precision res t l x third
} -result {1.0 1.0 1.0 1.0}

test basic-48.18.$noComp {expansion: list semantics} -constraints $constraints -body {
        set badcmd {
            list a b
            set apa 10
        }






|
<
<
<









<
|







889
890
891
892
893
894
895
896



897
898
899
900
901
902
903
904
905

906
907
908
909
910
911
912
913
        set leak [expr {$end - $tmp}]
    } -cleanup {
	unset end i tmp
	rename getbytes {}
	rename stress {}
} -result 0

test basic-48.17.$noComp {expansion: object safety} -constraints $constraints -body {



            set third [expr {1.0/3.0}]
            set l [list $third $third]
            set x [run {list $third {*}$l $third}]
	    set res [list]
            foreach t $x {
                lappend res [expr {$t * 3.0}]
            }
            set res
    } -cleanup {

        unset res t l x third
} -result {1.0 1.0 1.0 1.0}

test basic-48.18.$noComp {expansion: list semantics} -constraints $constraints -body {
        set badcmd {
            list a b
            set apa 10
        }

Changes to tests/util.test.

381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
....
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
....
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
test util-5.50 {Tcl_StringMatch} {
    Wrapper_Tcl_StringMatch *. ""
} 0
test util-5.51 {Tcl_StringMatch} {
    Wrapper_Tcl_StringMatch "" ""
} 1

test util-6.1 {Tcl_PrintDouble - using tcl_precision} -setup {
    set old_precision $::tcl_precision
    set ::tcl_precision 12
} -body {
    concat x[expr 1.4]
} -cleanup {
    set ::tcl_precision $old_precision
} -result {x1.4}
test util-6.2 {Tcl_PrintDouble - using tcl_precision} -setup {
    set old_precision $::tcl_precision
    set ::tcl_precision 12
} -body {
    concat x[expr 1.39999999999]
} -cleanup {
    set ::tcl_precision $old_precision
} -result {x1.39999999999}
test util-6.3 {Tcl_PrintDouble - using tcl_precision} -setup {
    set old_precision $::tcl_precision
    set ::tcl_precision 12
} -body {
    concat x[expr 1.399999999999]
} -cleanup {
    set ::tcl_precision $old_precision
} -result {x1.4}
test util-6.4 {Tcl_PrintDouble - using tcl_precision} -setup {
    set old_precision $::tcl_precision
    set ::tcl_precision 5
} -body {
    concat x[expr 1.123412341234]
} -cleanup {
    set tcl_precision $old_precision
} -result {x1.1234}
test util-6.5 {Tcl_PrintDouble - make sure there's a decimal point} {
    concat x[expr 2.0]
} {x2.0}
test util-6.6 {Tcl_PrintDouble - make sure there's a decimal point} {
    concat x[expr 3.0e98]
} {x3e+98}

test util-7.1 {TclPrecTraceProc - unset callbacks} -setup {
    set old_precision $::tcl_precision
} -body {
    set tcl_precision 7
    set x $tcl_precision
    unset tcl_precision
    list $x $tcl_precision
} -cleanup {
    set ::tcl_precision $old_precision
} -result {7 7}
test util-7.2 {TclPrecTraceProc - read traces, sharing among interpreters}  -setup {
    set old_precision $::tcl_precision
} -body {
    set tcl_precision 12
    interp create child
    set x [child eval set tcl_precision]
    child eval {set tcl_precision 6}
    interp delete child
    list $x $tcl_precision
} -cleanup {
    set ::tcl_precision $old_precision
} -result {12 6}
test util-7.3 {TclPrecTraceProc - write traces, safe interpreters} -setup {
    set old_precision $::tcl_precision
} -body {
    set tcl_precision 12
    interp create -safe child
    set x [child eval {
	list [catch {set tcl_precision 8} msg] $msg
    }]
    interp delete child
    list $x $tcl_precision
} -cleanup {
    set ::tcl_precision $old_precision
} -result {{1 {can't set "tcl_precision": can't modify precision from a safe interpreter}} 12}
test util-7.4 {TclPrecTraceProc - write traces, bogus values} -setup {
    set old_precision $::tcl_precision
} -body {
    set tcl_precision 12
    list [catch {set tcl_precision abc} msg] $msg $tcl_precision
} -cleanup {
    set ::tcl_precision $old_precision
} -result {1 {can't set "tcl_precision": improper value for precision} 12}

# This test always succeeded in the C locale anyway...
test util-8.1 {TclNeedSpace - correct UTF8 handling} {
    # Bug 411825
    # Note that this test relies on the fact that
    # [interp target] calls on Tcl_AppendElement()
    # which calls on TclNeedSpace().  If [interp target]
    # is ever updated, this test will no longer test
................................................................................
    }
    -result 0x8010000000000000
    -cleanup {
	unset x
    }
}

set saved_precision $::tcl_precision
foreach ::tcl_precision {0 12} {
    for {set e -312} {$e < -9} {incr e} {
	test util-16.1.$::tcl_precision.$e {shortening of numbers} \
	    "expr 1.1e$e" 1.1e$e
    }
}
set tcl_precision 0
for {set e -9} {$e < -4} {incr e} {
    test util-16.1.$::tcl_precision.$e {shortening of numbers} \
	"expr 1.1e$e" 1.1e$e
}
set tcl_precision 12
for {set e -9} {$e < -4} {incr e} {
    test util-16.1.$::tcl_precision.$e {8.4 compatible formatting of doubles} \
	"expr 1.1e$e" 1.1e[format %+03d $e]
}
foreach ::tcl_precision {0 12} {
    test util-16.1.$::tcl_precision.-4 {shortening of numbers} \
	{expr 1.1e-4} \
	0.00011
    test util-16.1.$::tcl_precision.-3 {shortening of numbers} \
	{expr 1.1e-3} \
	0.0011
    test util-16.1.$::tcl_precision.-2 {shortening of numbers} \
	{expr 1.1e-2} \
	0.011
    test util-16.1.$::tcl_precision.-1 {shortening of numbers} \
	{expr 1.1e-1} \
	0.11
    test util-16.1.$::tcl_precision.0 {shortening of numbers} \
	{expr 1.1} \
	1.1
    for {set e 1} {$e < 17} {incr e} {
	test util-16.1.$::tcl_precision.$e {shortening of numbers} \
	    "expr 11[string repeat 0 [expr {$e-1}]].0" \
	    11[string repeat 0 [expr {$e-1}]].0
    }
    for {set e 17} {$e < 309} {incr e} {
	test util-16.1.$::tcl_precision.$e {shortening of numbers} \
	    "expr 1.1e$e" 1.1e+$e
    }
}
set tcl_precision 17
test util-16.1.17.-300 {8.4 compatible formatting of doubles} \
    {expr 1e-300} \
    1e-300
test util-16.1.17.-299 {8.4 compatible formatting of doubles} \
    {expr 1e-299} \
    9.9999999999999999e-300
test util-16.1.17.-298 {8.4 compatible formatting of doubles} \
    {expr 1e-298} \
    9.9999999999999991e-299
test util-16.1.17.-297 {8.4 compatible formatting of doubles} \
    {expr 1e-297} \
    1e-297
test util-16.1.17.-296 {8.4 compatible formatting of doubles} \
    {expr 1e-296} \
    1e-296
test util-16.1.17.-295 {8.4 compatible formatting of doubles} \
    {expr 1e-295} \
    1.0000000000000001e-295
test util-16.1.17.-294 {8.4 compatible formatting of doubles} \
    {expr 1e-294} \
    1e-294
test util-16.1.17.-293 {8.4 compatible formatting of doubles} \
    {expr 1e-293} \
    1.0000000000000001e-293
test util-16.1.17.-292 {8.4 compatible formatting of doubles} \
    {expr 1e-292} \
    1.0000000000000001e-292
test util-16.1.17.-291 {8.4 compatible formatting of doubles} \
    {expr 1e-291} \
    9.9999999999999996e-292
test util-16.1.17.-290 {8.4 compatible formatting of doubles} \
    {expr 1e-290} \
    1.0000000000000001e-290
test util-16.1.17.-289 {8.4 compatible formatting of doubles} \
    {expr 1e-289} \
    1e-289
test util-16.1.17.-288 {8.4 compatible formatting of doubles} \
    {expr 1e-288} \
    1.0000000000000001e-288
test util-16.1.17.-287 {8.4 compatible formatting of doubles} \
    {expr 1e-287} \
    1e-287
test util-16.1.17.-286 {8.4 compatible formatting of doubles} \
    {expr 1e-286} \
    1.0000000000000001e-286
test util-16.1.17.-285 {8.4 compatible formatting of doubles} \
    {expr 1e-285} \
    1.0000000000000001e-285
test util-16.1.17.-284 {8.4 compatible formatting of doubles} \
    {expr 1e-284} \
    1e-284
test util-16.1.17.-283 {8.4 compatible formatting of doubles} \
    {expr 1e-283} \
    9.9999999999999995e-284
test util-16.1.17.-282 {8.4 compatible formatting of doubles} \
    {expr 1e-282} \
    1e-282
test util-16.1.17.-281 {8.4 compatible formatting of doubles} \
    {expr 1e-281} \
    1e-281
test util-16.1.17.-280 {8.4 compatible formatting of doubles} \
    {expr 1e-280} \
    9.9999999999999996e-281
test util-16.1.17.-279 {8.4 compatible formatting of doubles} \
    {expr 1e-279} \
    1.0000000000000001e-279
test util-16.1.17.-278 {8.4 compatible formatting of doubles} \
    {expr 1e-278} \
    9.9999999999999994e-279
test util-16.1.17.-277 {8.4 compatible formatting of doubles} \
    {expr 1e-277} \
    9.9999999999999997e-278
test util-16.1.17.-276 {8.4 compatible formatting of doubles} \
    {expr 1e-276} \
    1.0000000000000001e-276
test util-16.1.17.-275 {8.4 compatible formatting of doubles} \
    {expr 1e-275} \
    9.9999999999999993e-276
test util-16.1.17.-274 {8.4 compatible formatting of doubles} \
    {expr 1e-274} \
    9.9999999999999997e-275
test util-16.1.17.-273 {8.4 compatible formatting of doubles} \
    {expr 1e-273} \
    1.0000000000000001e-273
test util-16.1.17.-272 {8.4 compatible formatting of doubles} \
    {expr 1e-272} \
    9.9999999999999993e-273
test util-16.1.17.-271 {8.4 compatible formatting of doubles} \
    {expr 1e-271} \
    9.9999999999999996e-272
test util-16.1.17.-270 {8.4 compatible formatting of doubles} \
    {expr 1e-270} \
    1e-270
test util-16.1.17.-269 {8.4 compatible formatting of doubles} \
    {expr 1e-269} \
    9.9999999999999996e-270
test util-16.1.17.-268 {8.4 compatible formatting of doubles} \
    {expr 1e-268} \
    9.9999999999999996e-269
test util-16.1.17.-267 {8.4 compatible formatting of doubles} \
    {expr 1e-267} \
    9.9999999999999998e-268
test util-16.1.17.-266 {8.4 compatible formatting of doubles} \
    {expr 1e-266} \
    9.9999999999999998e-267
test util-16.1.17.-265 {8.4 compatible formatting of doubles} \
    {expr 1e-265} \
    9.9999999999999998e-266
test util-16.1.17.-264 {8.4 compatible formatting of doubles} \
    {expr 1e-264} \
    1e-264
test util-16.1.17.-263 {8.4 compatible formatting of doubles} \
    {expr 1e-263} \
    1e-263
test util-16.1.17.-262 {8.4 compatible formatting of doubles} \
    {expr 1e-262} \
    1e-262
test util-16.1.17.-261 {8.4 compatible formatting of doubles} \
    {expr 1e-261} \
    9.9999999999999998e-262
test util-16.1.17.-260 {8.4 compatible formatting of doubles} \
    {expr 1e-260} \
    9.9999999999999996e-261
test util-16.1.17.-259 {8.4 compatible formatting of doubles} \
    {expr 1e-259} \
    1.0000000000000001e-259
test util-16.1.17.-258 {8.4 compatible formatting of doubles} \
    {expr 1e-258} \
    9.9999999999999995e-259
test util-16.1.17.-257 {8.4 compatible formatting of doubles} \
    {expr 1e-257} \
    9.9999999999999998e-258
test util-16.1.17.-256 {8.4 compatible formatting of doubles} \
    {expr 1e-256} \
    9.9999999999999998e-257
test util-16.1.17.-255 {8.4 compatible formatting of doubles} \
    {expr 1e-255} \
    1e-255
test util-16.1.17.-254 {8.4 compatible formatting of doubles} \
    {expr 1e-254} \
    9.9999999999999991e-255
test util-16.1.17.-253 {8.4 compatible formatting of doubles} \
    {expr 1e-253} \
    1.0000000000000001e-253
test util-16.1.17.-252 {8.4 compatible formatting of doubles} \
    {expr 1e-252} \
    9.9999999999999994e-253
test util-16.1.17.-251 {8.4 compatible formatting of doubles} \
    {expr 1e-251} \
    1e-251
test util-16.1.17.-250 {8.4 compatible formatting of doubles} \
    {expr 1e-250} \
    1.0000000000000001e-250
test util-16.1.17.-249 {8.4 compatible formatting of doubles} \
    {expr 1e-249} \
    1.0000000000000001e-249
test util-16.1.17.-248 {8.4 compatible formatting of doubles} \
    {expr 1e-248} \
    9.9999999999999998e-249
test util-16.1.17.-247 {8.4 compatible formatting of doubles} \
    {expr 1e-247} \
    1e-247
test util-16.1.17.-246 {8.4 compatible formatting of doubles} \
    {expr 1e-246} \
    9.9999999999999996e-247
test util-16.1.17.-245 {8.4 compatible formatting of doubles} \
    {expr 1e-245} \
    9.9999999999999993e-246
test util-16.1.17.-244 {8.4 compatible formatting of doubles} \
    {expr 1e-244} \
    9.9999999999999993e-245
test util-16.1.17.-243 {8.4 compatible formatting of doubles} \
    {expr 1e-243} \
    1e-243
test util-16.1.17.-242 {8.4 compatible formatting of doubles} \
    {expr 1e-242} \
    9.9999999999999997e-243
test util-16.1.17.-241 {8.4 compatible formatting of doubles} \
    {expr 1e-241} \
    9.9999999999999997e-242
test util-16.1.17.-240 {8.4 compatible formatting of doubles} \
    {expr 1e-240} \
    9.9999999999999997e-241
test util-16.1.17.-239 {8.4 compatible formatting of doubles} \
    {expr 1e-239} \
    1.0000000000000001e-239
test util-16.1.17.-238 {8.4 compatible formatting of doubles} \
    {expr 1e-238} \
    9.9999999999999999e-239
test util-16.1.17.-237 {8.4 compatible formatting of doubles} \
    {expr 1e-237} \
    9.9999999999999999e-238
test util-16.1.17.-236 {8.4 compatible formatting of doubles} \
    {expr 1e-236} \
    1e-236
test util-16.1.17.-235 {8.4 compatible formatting of doubles} \
    {expr 1e-235} \
    9.9999999999999996e-236
test util-16.1.17.-234 {8.4 compatible formatting of doubles} \
    {expr 1e-234} \
    9.9999999999999996e-235
test util-16.1.17.-233 {8.4 compatible formatting of doubles} \
    {expr 1e-233} \
    9.9999999999999996e-234
test util-16.1.17.-232 {8.4 compatible formatting of doubles} \
    {expr 1e-232} \
    1e-232
test util-16.1.17.-231 {8.4 compatible formatting of doubles} \
    {expr 1e-231} \
    9.9999999999999999e-232
test util-16.1.17.-230 {8.4 compatible formatting of doubles} \
    {expr 1e-230} \
    1e-230
test util-16.1.17.-229 {8.4 compatible formatting of doubles} \
    {expr 1e-229} \
    1.0000000000000001e-229
test util-16.1.17.-228 {8.4 compatible formatting of doubles} \
    {expr 1e-228} \
    1e-228
test util-16.1.17.-227 {8.4 compatible formatting of doubles} \
    {expr 1e-227} \
    9.9999999999999994e-228
test util-16.1.17.-226 {8.4 compatible formatting of doubles} \
    {expr 1e-226} \
    9.9999999999999992e-227
test util-16.1.17.-225 {8.4 compatible formatting of doubles} \
    {expr 1e-225} \
    9.9999999999999996e-226
test util-16.1.17.-224 {8.4 compatible formatting of doubles} \
    {expr 1e-224} \
    1e-224
test util-16.1.17.-223 {8.4 compatible formatting of doubles} \
    {expr 1e-223} \
    9.9999999999999997e-224
test util-16.1.17.-222 {8.4 compatible formatting of doubles} \
    {expr 1e-222} \
    1e-222
test util-16.1.17.-221 {8.4 compatible formatting of doubles} \
    {expr 1e-221} \
    1e-221
test util-16.1.17.-220 {8.4 compatible formatting of doubles} \
    {expr 1e-220} \
    9.9999999999999999e-221
test util-16.1.17.-219 {8.4 compatible formatting of doubles} \
    {expr 1e-219} \
    1e-219
test util-16.1.17.-218 {8.4 compatible formatting of doubles} \
    {expr 1e-218} \
    1e-218
test util-16.1.17.-217 {8.4 compatible formatting of doubles} \
    {expr 1e-217} \
    1.0000000000000001e-217
test util-16.1.17.-216 {8.4 compatible formatting of doubles} \
    {expr 1e-216} \
    1e-216
test util-16.1.17.-215 {8.4 compatible formatting of doubles} \
    {expr 1e-215} \
    1e-215
test util-16.1.17.-214 {8.4 compatible formatting of doubles} \
    {expr 1e-214} \
    9.9999999999999991e-215
test util-16.1.17.-213 {8.4 compatible formatting of doubles} \
    {expr 1e-213} \
    9.9999999999999995e-214
test util-16.1.17.-212 {8.4 compatible formatting of doubles} \
    {expr 1e-212} \
    9.9999999999999995e-213
test util-16.1.17.-211 {8.4 compatible formatting of doubles} \
    {expr 1e-211} \
    1.0000000000000001e-211
test util-16.1.17.-210 {8.4 compatible formatting of doubles} \
    {expr 1e-210} \
    1e-210
test util-16.1.17.-209 {8.4 compatible formatting of doubles} \
    {expr 1e-209} \
    1e-209
test util-16.1.17.-208 {8.4 compatible formatting of doubles} \
    {expr 1e-208} \
    1.0000000000000001e-208
test util-16.1.17.-207 {8.4 compatible formatting of doubles} \
    {expr 1e-207} \
    9.9999999999999993e-208
test util-16.1.17.-206 {8.4 compatible formatting of doubles} \
    {expr 1e-206} \
    1e-206
test util-16.1.17.-205 {8.4 compatible formatting of doubles} \
    {expr 1e-205} \
    1e-205
test util-16.1.17.-204 {8.4 compatible formatting of doubles} \
    {expr 1e-204} \
    1e-204
test util-16.1.17.-203 {8.4 compatible formatting of doubles} \
    {expr 1e-203} \
    1e-203
test util-16.1.17.-202 {8.4 compatible formatting of doubles} \
    {expr 1e-202} \
    1e-202
test util-16.1.17.-201 {8.4 compatible formatting of doubles} \
    {expr 1e-201} \
    9.9999999999999995e-202
test util-16.1.17.-200 {8.4 compatible formatting of doubles} \
    {expr 1e-200} \
    9.9999999999999998e-201
test util-16.1.17.-199 {8.4 compatible formatting of doubles} \
    {expr 1e-199} \
    9.9999999999999998e-200
test util-16.1.17.-198 {8.4 compatible formatting of doubles} \
    {expr 1e-198} \
    9.9999999999999991e-199
test util-16.1.17.-197 {8.4 compatible formatting of doubles} \
    {expr 1e-197} \
    9.9999999999999999e-198
test util-16.1.17.-196 {8.4 compatible formatting of doubles} \
    {expr 1e-196} \
    1e-196
test util-16.1.17.-195 {8.4 compatible formatting of doubles} \
    {expr 1e-195} \
    1.0000000000000001e-195
test util-16.1.17.-194 {8.4 compatible formatting of doubles} \
    {expr 1e-194} \
    1e-194
test util-16.1.17.-193 {8.4 compatible formatting of doubles} \
    {expr 1e-193} \
    1e-193
test util-16.1.17.-192 {8.4 compatible formatting of doubles} \
    {expr 1e-192} \
    1.0000000000000001e-192
test util-16.1.17.-191 {8.4 compatible formatting of doubles} \
    {expr 1e-191} \
    1e-191
test util-16.1.17.-190 {8.4 compatible formatting of doubles} \
    {expr 1e-190} \
    1e-190
test util-16.1.17.-189 {8.4 compatible formatting of doubles} \
    {expr 1e-189} \
    1.0000000000000001e-189
test util-16.1.17.-188 {8.4 compatible formatting of doubles} \
    {expr 1e-188} \
    9.9999999999999995e-189
test util-16.1.17.-187 {8.4 compatible formatting of doubles} \
    {expr 1e-187} \
    1e-187
test util-16.1.17.-186 {8.4 compatible formatting of doubles} \
    {expr 1e-186} \
    9.9999999999999991e-187
test util-16.1.17.-185 {8.4 compatible formatting of doubles} \
    {expr 1e-185} \
    9.9999999999999999e-186
test util-16.1.17.-184 {8.4 compatible formatting of doubles} \
    {expr 1e-184} \
    1.0000000000000001e-184
test util-16.1.17.-183 {8.4 compatible formatting of doubles} \
    {expr 1e-183} \
    1e-183
test util-16.1.17.-182 {8.4 compatible formatting of doubles} \
    {expr 1e-182} \
    1e-182
test util-16.1.17.-181 {8.4 compatible formatting of doubles} \
    {expr 1e-181} \
    1e-181
test util-16.1.17.-180 {8.4 compatible formatting of doubles} \
    {expr 1e-180} \
    1e-180
test util-16.1.17.-179 {8.4 compatible formatting of doubles} \
    {expr 1e-179} \
    1e-179
test util-16.1.17.-178 {8.4 compatible formatting of doubles} \
    {expr 1e-178} \
    9.9999999999999995e-179
test util-16.1.17.-177 {8.4 compatible formatting of doubles} \
    {expr 1e-177} \
    9.9999999999999995e-178
test util-16.1.17.-176 {8.4 compatible formatting of doubles} \
    {expr 1e-176} \
    1e-176
test util-16.1.17.-175 {8.4 compatible formatting of doubles} \
    {expr 1e-175} \
    1e-175
test util-16.1.17.-174 {8.4 compatible formatting of doubles} \
    {expr 1e-174} \
    1e-174
test util-16.1.17.-173 {8.4 compatible formatting of doubles} \
    {expr 1e-173} \
    1e-173
test util-16.1.17.-172 {8.4 compatible formatting of doubles} \
    {expr 1e-172} \
    1e-172
test util-16.1.17.-171 {8.4 compatible formatting of doubles} \
    {expr 1e-171} \
    9.9999999999999998e-172
test util-16.1.17.-170 {8.4 compatible formatting of doubles} \
    {expr 1e-170} \
    9.9999999999999998e-171
test util-16.1.17.-169 {8.4 compatible formatting of doubles} \
    {expr 1e-169} \
    1e-169
test util-16.1.17.-168 {8.4 compatible formatting of doubles} \
    {expr 1e-168} \
    1e-168
test util-16.1.17.-167 {8.4 compatible formatting of doubles} \
    {expr 1e-167} \
    1e-167
test util-16.1.17.-166 {8.4 compatible formatting of doubles} \
    {expr 1e-166} \
    1e-166
test util-16.1.17.-165 {8.4 compatible formatting of doubles} \
    {expr 1e-165} \
    1e-165
test util-16.1.17.-164 {8.4 compatible formatting of doubles} \
    {expr 1e-164} \
    9.9999999999999996e-165
test util-16.1.17.-163 {8.4 compatible formatting of doubles} \
    {expr 1e-163} \
    9.9999999999999992e-164
test util-16.1.17.-162 {8.4 compatible formatting of doubles} \
    {expr 1e-162} \
    9.9999999999999995e-163
test util-16.1.17.-161 {8.4 compatible formatting of doubles} \
    {expr 1e-161} \
    1e-161
test util-16.1.17.-160 {8.4 compatible formatting of doubles} \
    {expr 1e-160} \
    9.9999999999999999e-161
test util-16.1.17.-159 {8.4 compatible formatting of doubles} \
    {expr 1e-159} \
    9.9999999999999999e-160
test util-16.1.17.-158 {8.4 compatible formatting of doubles} \
    {expr 1e-158} \
    1.0000000000000001e-158
test util-16.1.17.-157 {8.4 compatible formatting of doubles} \
    {expr 1e-157} \
    9.9999999999999994e-158
test util-16.1.17.-156 {8.4 compatible formatting of doubles} \
    {expr 1e-156} \
    1e-156
test util-16.1.17.-155 {8.4 compatible formatting of doubles} \
    {expr 1e-155} \
    1e-155
test util-16.1.17.-154 {8.4 compatible formatting of doubles} \
    {expr 1e-154} \
    9.9999999999999997e-155
test util-16.1.17.-153 {8.4 compatible formatting of doubles} \
    {expr 1e-153} \
    1e-153
test util-16.1.17.-152 {8.4 compatible formatting of doubles} \
    {expr 1e-152} \
    1.0000000000000001e-152
test util-16.1.17.-151 {8.4 compatible formatting of doubles} \
    {expr 1e-151} \
    9.9999999999999994e-152
test util-16.1.17.-150 {8.4 compatible formatting of doubles} \
    {expr 1e-150} \
    1e-150
test util-16.1.17.-149 {8.4 compatible formatting of doubles} \
    {expr 1e-149} \
    9.9999999999999998e-150
test util-16.1.17.-148 {8.4 compatible formatting of doubles} \
    {expr 1e-148} \
    9.9999999999999994e-149
test util-16.1.17.-147 {8.4 compatible formatting of doubles} \
    {expr 1e-147} \
    9.9999999999999997e-148
test util-16.1.17.-146 {8.4 compatible formatting of doubles} \
    {expr 1e-146} \
    1e-146
test util-16.1.17.-145 {8.4 compatible formatting of doubles} \
    {expr 1e-145} \
    9.9999999999999991e-146
test util-16.1.17.-144 {8.4 compatible formatting of doubles} \
    {expr 1e-144} \
    9.9999999999999995e-145
test util-16.1.17.-143 {8.4 compatible formatting of doubles} \
    {expr 1e-143} \
    9.9999999999999995e-144
test util-16.1.17.-142 {8.4 compatible formatting of doubles} \
    {expr 1e-142} \
    1e-142
test util-16.1.17.-141 {8.4 compatible formatting of doubles} \
    {expr 1e-141} \
    1e-141
test util-16.1.17.-140 {8.4 compatible formatting of doubles} \
    {expr 1e-140} \
    9.9999999999999998e-141
test util-16.1.17.-139 {8.4 compatible formatting of doubles} \
    {expr 1e-139} \
    1e-139
test util-16.1.17.-138 {8.4 compatible formatting of doubles} \
    {expr 1e-138} \
    1.0000000000000001e-138
test util-16.1.17.-137 {8.4 compatible formatting of doubles} \
    {expr 1e-137} \
    9.9999999999999998e-138
test util-16.1.17.-136 {8.4 compatible formatting of doubles} \
    {expr 1e-136} \
    1e-136
test util-16.1.17.-135 {8.4 compatible formatting of doubles} \
    {expr 1e-135} \
    1e-135
test util-16.1.17.-134 {8.4 compatible formatting of doubles} \
    {expr 1e-134} \
    1e-134
test util-16.1.17.-133 {8.4 compatible formatting of doubles} \
    {expr 1e-133} \
    1.0000000000000001e-133
test util-16.1.17.-132 {8.4 compatible formatting of doubles} \
    {expr 1e-132} \
    9.9999999999999999e-133
test util-16.1.17.-131 {8.4 compatible formatting of doubles} \
    {expr 1e-131} \
    9.9999999999999999e-132
test util-16.1.17.-130 {8.4 compatible formatting of doubles} \
    {expr 1e-130} \
    1.0000000000000001e-130
test util-16.1.17.-129 {8.4 compatible formatting of doubles} \
    {expr 1e-129} \
    9.9999999999999993e-130
test util-16.1.17.-128 {8.4 compatible formatting of doubles} \
    {expr 1e-128} \
    1.0000000000000001e-128
test util-16.1.17.-127 {8.4 compatible formatting of doubles} \
    {expr 1e-127} \
    1e-127
test util-16.1.17.-126 {8.4 compatible formatting of doubles} \
    {expr 1e-126} \
    9.9999999999999995e-127
test util-16.1.17.-125 {8.4 compatible formatting of doubles} \
    {expr 1e-125} \
    1e-125
test util-16.1.17.-124 {8.4 compatible formatting of doubles} \
    {expr 1e-124} \
    9.9999999999999993e-125
test util-16.1.17.-123 {8.4 compatible formatting of doubles} \
    {expr 1e-123} \
    1.0000000000000001e-123
test util-16.1.17.-122 {8.4 compatible formatting of doubles} \
    {expr 1e-122} \
    1.0000000000000001e-122
test util-16.1.17.-121 {8.4 compatible formatting of doubles} \
    {expr 1e-121} \
    9.9999999999999998e-122
test util-16.1.17.-120 {8.4 compatible formatting of doubles} \
    {expr 1e-120} \
    9.9999999999999998e-121
test util-16.1.17.-119 {8.4 compatible formatting of doubles} \
    {expr 1e-119} \
    1e-119
test util-16.1.17.-118 {8.4 compatible formatting of doubles} \
    {expr 1e-118} \
    9.9999999999999999e-119
test util-16.1.17.-117 {8.4 compatible formatting of doubles} \
    {expr 1e-117} \
    1e-117
test util-16.1.17.-116 {8.4 compatible formatting of doubles} \
    {expr 1e-116} \
    9.9999999999999999e-117
test util-16.1.17.-115 {8.4 compatible formatting of doubles} \
    {expr 1e-115} \
    1.0000000000000001e-115
test util-16.1.17.-114 {8.4 compatible formatting of doubles} \
    {expr 1e-114} \
    1.0000000000000001e-114
test util-16.1.17.-113 {8.4 compatible formatting of doubles} \
    {expr 1e-113} \
    9.9999999999999998e-114
test util-16.1.17.-112 {8.4 compatible formatting of doubles} \
    {expr 1e-112} \
    9.9999999999999995e-113
test util-16.1.17.-111 {8.4 compatible formatting of doubles} \
    {expr 1e-111} \
    1.0000000000000001e-111
test util-16.1.17.-110 {8.4 compatible formatting of doubles} \
    {expr 1e-110} \
    1.0000000000000001e-110
test util-16.1.17.-109 {8.4 compatible formatting of doubles} \
    {expr 1e-109} \
    9.9999999999999999e-110
test util-16.1.17.-108 {8.4 compatible formatting of doubles} \
    {expr 1e-108} \
    1e-108
test util-16.1.17.-107 {8.4 compatible formatting of doubles} \
    {expr 1e-107} \
    1e-107
test util-16.1.17.-106 {8.4 compatible formatting of doubles} \
    {expr 1e-106} \
    9.9999999999999994e-107
test util-16.1.17.-105 {8.4 compatible formatting of doubles} \
    {expr 1e-105} \
    9.9999999999999997e-106
test util-16.1.17.-104 {8.4 compatible formatting of doubles} \
    {expr 1e-104} \
    9.9999999999999993e-105
test util-16.1.17.-103 {8.4 compatible formatting of doubles} \
    {expr 1e-103} \
    9.9999999999999996e-104
test util-16.1.17.-102 {8.4 compatible formatting of doubles} \
    {expr 1e-102} \
    9.9999999999999993e-103
test util-16.1.17.-101 {8.4 compatible formatting of doubles} \
    {expr 1e-101} \
    1.0000000000000001e-101
test util-16.1.17.-100 {8.4 compatible formatting of doubles} \
    {expr 1e-100} \
    1e-100
test util-16.1.17.-99 {8.4 compatible formatting of doubles} \
    {expr 1e-99} \
    1e-99
test util-16.1.17.-98 {8.4 compatible formatting of doubles} \
    {expr 1e-98} \
    9.9999999999999994e-99
test util-16.1.17.-97 {8.4 compatible formatting of doubles} \
    {expr 1e-97} \
    1e-97
test util-16.1.17.-96 {8.4 compatible formatting of doubles} \
    {expr 1e-96} \
    9.9999999999999991e-97
test util-16.1.17.-95 {8.4 compatible formatting of doubles} \
    {expr 1e-95} \
    9.9999999999999999e-96
test util-16.1.17.-94 {8.4 compatible formatting of doubles} \
    {expr 1e-94} \
    9.9999999999999996e-95
test util-16.1.17.-93 {8.4 compatible formatting of doubles} \
    {expr 1e-93} \
    9.999999999999999e-94
test util-16.1.17.-92 {8.4 compatible formatting of doubles} \
    {expr 1e-92} \
    9.9999999999999999e-93
test util-16.1.17.-91 {8.4 compatible formatting of doubles} \
    {expr 1e-91} \
    1e-91
test util-16.1.17.-90 {8.4 compatible formatting of doubles} \
    {expr 1e-90} \
    9.9999999999999999e-91
test util-16.1.17.-89 {8.4 compatible formatting of doubles} \
    {expr 1e-89} \
    1e-89
test util-16.1.17.-88 {8.4 compatible formatting of doubles} \
    {expr 1e-88} \
    9.9999999999999993e-89
test util-16.1.17.-87 {8.4 compatible formatting of doubles} \
    {expr 1e-87} \
    1e-87
test util-16.1.17.-86 {8.4 compatible formatting of doubles} \
    {expr 1e-86} \
    1.0000000000000001e-86
test util-16.1.17.-85 {8.4 compatible formatting of doubles} \
    {expr 1e-85} \
    9.9999999999999998e-86
test util-16.1.17.-84 {8.4 compatible formatting of doubles} \
    {expr 1e-84} \
    1e-84
test util-16.1.17.-83 {8.4 compatible formatting of doubles} \
    {expr 1e-83} \
    1e-83
test util-16.1.17.-82 {8.4 compatible formatting of doubles} \
    {expr 1e-82} \
    9.9999999999999996e-83
test util-16.1.17.-81 {8.4 compatible formatting of doubles} \
    {expr 1e-81} \
    9.9999999999999996e-82
test util-16.1.17.-80 {8.4 compatible formatting of doubles} \
    {expr 1e-80} \
    9.9999999999999996e-81
test util-16.1.17.-79 {8.4 compatible formatting of doubles} \
    {expr 1e-79} \
    1e-79
test util-16.1.17.-78 {8.4 compatible formatting of doubles} \
    {expr 1e-78} \
    1e-78
test util-16.1.17.-77 {8.4 compatible formatting of doubles} \
    {expr 1e-77} \
    9.9999999999999993e-78
test util-16.1.17.-76 {8.4 compatible formatting of doubles} \
    {expr 1e-76} \
    9.9999999999999993e-77
test util-16.1.17.-75 {8.4 compatible formatting of doubles} \
    {expr 1e-75} \
    9.9999999999999996e-76
test util-16.1.17.-74 {8.4 compatible formatting of doubles} \
    {expr 1e-74} \
    9.9999999999999996e-75
test util-16.1.17.-73 {8.4 compatible formatting of doubles} \
    {expr 1e-73} \
    1e-73
test util-16.1.17.-72 {8.4 compatible formatting of doubles} \
    {expr 1e-72} \
    9.9999999999999997e-73
test util-16.1.17.-71 {8.4 compatible formatting of doubles} \
    {expr 1e-71} \
    9.9999999999999992e-72
test util-16.1.17.-70 {8.4 compatible formatting of doubles} \
    {expr 1e-70} \
    1e-70
test util-16.1.17.-69 {8.4 compatible formatting of doubles} \
    {expr 1e-69} \
    9.9999999999999996e-70
test util-16.1.17.-68 {8.4 compatible formatting of doubles} \
    {expr 1e-68} \
    1.0000000000000001e-68
test util-16.1.17.-67 {8.4 compatible formatting of doubles} \
    {expr 1e-67} \
    9.9999999999999994e-68
test util-16.1.17.-66 {8.4 compatible formatting of doubles} \
    {expr 1e-66} \
    9.9999999999999998e-67
test util-16.1.17.-65 {8.4 compatible formatting of doubles} \
    {expr 1e-65} \
    9.9999999999999992e-66
test util-16.1.17.-64 {8.4 compatible formatting of doubles} \
    {expr 1e-64} \
    9.9999999999999997e-65
test util-16.1.17.-63 {8.4 compatible formatting of doubles} \
    {expr 1e-63} \
    1.0000000000000001e-63
test util-16.1.17.-62 {8.4 compatible formatting of doubles} \
    {expr 1e-62} \
    1e-62
test util-16.1.17.-61 {8.4 compatible formatting of doubles} \
    {expr 1e-61} \
    1e-61
test util-16.1.17.-60 {8.4 compatible formatting of doubles} \
    {expr 1e-60} \
    9.9999999999999997e-61
test util-16.1.17.-59 {8.4 compatible formatting of doubles} \
    {expr 1e-59} \
    1e-59
test util-16.1.17.-58 {8.4 compatible formatting of doubles} \
    {expr 1e-58} \
    1e-58
test util-16.1.17.-57 {8.4 compatible formatting of doubles} \
    {expr 1e-57} \
    9.9999999999999995e-58
test util-16.1.17.-56 {8.4 compatible formatting of doubles} \
    {expr 1e-56} \
    1e-56
test util-16.1.17.-55 {8.4 compatible formatting of doubles} \
    {expr 1e-55} \
    9.9999999999999999e-56
test util-16.1.17.-54 {8.4 compatible formatting of doubles} \
    {expr 1e-54} \
    1e-54
test util-16.1.17.-53 {8.4 compatible formatting of doubles} \
    {expr 1e-53} \
    1e-53
test util-16.1.17.-52 {8.4 compatible formatting of doubles} \
    {expr 1e-52} \
    1e-52
test util-16.1.17.-51 {8.4 compatible formatting of doubles} \
    {expr 1e-51} \
    1e-51
test util-16.1.17.-50 {8.4 compatible formatting of doubles} \
    {expr 1e-50} \
    1e-50
test util-16.1.17.-49 {8.4 compatible formatting of doubles} \
    {expr 1e-49} \
    9.9999999999999994e-50
test util-16.1.17.-48 {8.4 compatible formatting of doubles} \
    {expr 1e-48} \
    9.9999999999999997e-49
test util-16.1.17.-47 {8.4 compatible formatting of doubles} \
    {expr 1e-47} \
    9.9999999999999997e-48
test util-16.1.17.-46 {8.4 compatible formatting of doubles} \
    {expr 1e-46} \
    1e-46
test util-16.1.17.-45 {8.4 compatible formatting of doubles} \
    {expr 1e-45} \
    9.9999999999999998e-46
test util-16.1.17.-44 {8.4 compatible formatting of doubles} \
    {expr 1e-44} \
    9.9999999999999995e-45
test util-16.1.17.-43 {8.4 compatible formatting of doubles} \
    {expr 1e-43} \
    1.0000000000000001e-43
test util-16.1.17.-42 {8.4 compatible formatting of doubles} \
    {expr 1e-42} \
    1e-42
test util-16.1.17.-41 {8.4 compatible formatting of doubles} \
    {expr 1e-41} \
    1e-41
test util-16.1.17.-40 {8.4 compatible formatting of doubles} \
    {expr 1e-40} \
    9.9999999999999993e-41
test util-16.1.17.-39 {8.4 compatible formatting of doubles} \
    {expr 1e-39} \
    9.9999999999999993e-40
test util-16.1.17.-38 {8.4 compatible formatting of doubles} \
    {expr 1e-38} \
    9.9999999999999996e-39
test util-16.1.17.-37 {8.4 compatible formatting of doubles} \
    {expr 1e-37} \
    1.0000000000000001e-37
test util-16.1.17.-36 {8.4 compatible formatting of doubles} \
    {expr 1e-36} \
    9.9999999999999994e-37
test util-16.1.17.-35 {8.4 compatible formatting of doubles} \
    {expr 1e-35} \
    1e-35
test util-16.1.17.-34 {8.4 compatible formatting of doubles} \
    {expr 1e-34} \
    9.9999999999999993e-35
test util-16.1.17.-33 {8.4 compatible formatting of doubles} \
    {expr 1e-33} \
    1.0000000000000001e-33
test util-16.1.17.-32 {8.4 compatible formatting of doubles} \
    {expr 1e-32} \
    1.0000000000000001e-32
test util-16.1.17.-31 {8.4 compatible formatting of doubles} \
    {expr 1e-31} \
    1.0000000000000001e-31
test util-16.1.17.-30 {8.4 compatible formatting of doubles} \
    {expr 1e-30} \
    1.0000000000000001e-30
test util-16.1.17.-29 {8.4 compatible formatting of doubles} \
    {expr 1e-29} \
    9.9999999999999994e-30
test util-16.1.17.-28 {8.4 compatible formatting of doubles} \
    {expr 1e-28} \
    9.9999999999999997e-29
test util-16.1.17.-27 {8.4 compatible formatting of doubles} \
    {expr 1e-27} \
    1e-27
test util-16.1.17.-26 {8.4 compatible formatting of doubles} \
    {expr 1e-26} \
    1e-26
test util-16.1.17.-25 {8.4 compatible formatting of doubles} \
    {expr 1e-25} \
    1e-25
test util-16.1.17.-24 {8.4 compatible formatting of doubles} \
    {expr 1e-24} \
    9.9999999999999992e-25
test util-16.1.17.-23 {8.4 compatible formatting of doubles} \
    {expr 1e-23} \
    9.9999999999999996e-24
test util-16.1.17.-22 {8.4 compatible formatting of doubles} \
    {expr 1e-22} \
    1e-22
test util-16.1.17.-21 {8.4 compatible formatting of doubles} \
    {expr 1e-21} \
    9.9999999999999991e-22
test util-16.1.17.-20 {8.4 compatible formatting of doubles} \
    {expr 1e-20} \
    9.9999999999999995e-21
test util-16.1.17.-19 {8.4 compatible formatting of doubles} \
    {expr 1e-19} \
    9.9999999999999998e-20
test util-16.1.17.-18 {8.4 compatible formatting of doubles} \
    {expr 1e-18} \
    1.0000000000000001e-18
test util-16.1.17.-17 {8.4 compatible formatting of doubles} \
    {expr 1e-17} \
    1.0000000000000001e-17
test util-16.1.17.-16 {8.4 compatible formatting of doubles} \
    {expr 1e-16} \
    9.9999999999999998e-17
test util-16.1.17.-15 {8.4 compatible formatting of doubles} \
    {expr 1e-15} \
    1.0000000000000001e-15
test util-16.1.17.-14 {8.4 compatible formatting of doubles} \
    {expr 1e-14} \
    1e-14
test util-16.1.17.-13 {8.4 compatible formatting of doubles} \
    {expr 1e-13} \
    1e-13
test util-16.1.17.-12 {8.4 compatible formatting of doubles} \
    {expr 1e-12} \
    9.9999999999999998e-13
test util-16.1.17.-11 {8.4 compatible formatting of doubles} \
    {expr 1e-11} \
    9.9999999999999994e-12
test util-16.1.17.-10 {8.4 compatible formatting of doubles} \
    {expr 1e-10} \
    1e-10
test util-16.1.17.-9 {8.4 compatible formatting of doubles} \
    {expr 1e-9} \
    1.0000000000000001e-09
test util-16.1.17.-8 {8.4 compatible formatting of doubles} \
    {expr 1e-8} \
    1e-08
test util-16.1.17.-7 {8.4 compatible formatting of doubles} \
    {expr 1e-7} \
    9.9999999999999995e-08
test util-16.1.17.-6 {8.4 compatible formatting of doubles} \
    {expr 1e-6} \
    9.9999999999999995e-07
test util-16.1.17.-5 {8.4 compatible formatting of doubles} \
    {expr 1e-5} \
    1.0000000000000001e-05
test util-16.1.17.-4 {8.4 compatible formatting of doubles} \
    {expr 1e-4} \
    0.0001
test util-16.1.17.-3 {8.4 compatible formatting of doubles} \
    {expr 1e-3} \
    0.001
test util-16.1.17.-2 {8.4 compatible formatting of doubles} \
    {expr 1e-2} \
    0.01
test util-16.1.17.-1 {8.4 compatible formatting of doubles} \
    {expr 1e-1} \
    0.10000000000000001
test util-16.1.17.0 {8.4 compatible formatting of doubles} \
    {expr 1e0} \
    1.0
test util-16.1.17.1 {8.4 compatible formatting of doubles} \
    {expr 1e1} \
    10.0
test util-16.1.17.2 {8.4 compatible formatting of doubles} \
    {expr 1e2} \
    100.0
test util-16.1.17.3 {8.4 compatible formatting of doubles} \
    {expr 1e3} \
    1000.0
test util-16.1.17.4 {8.4 compatible formatting of doubles} \
    {expr 1e4} \
    10000.0
test util-16.1.17.5 {8.4 compatible formatting of doubles} \
    {expr 1e5} \
    100000.0
test util-16.1.17.6 {8.4 compatible formatting of doubles} \
    {expr 1e6} \
    1000000.0
test util-16.1.17.7 {8.4 compatible formatting of doubles} \
    {expr 1e7} \
    10000000.0
test util-16.1.17.8 {8.4 compatible formatting of doubles} \
    {expr 1e8} \
    100000000.0
test util-16.1.17.9 {8.4 compatible formatting of doubles} \
    {expr 1e9} \
    1000000000.0
test util-16.1.17.10 {8.4 compatible formatting of doubles} \
    {expr 1e10} \
    10000000000.0
test util-16.1.17.11 {8.4 compatible formatting of doubles} \
    {expr 1e11} \
    100000000000.0
test util-16.1.17.12 {8.4 compatible formatting of doubles} \
    {expr 1e12} \
    1000000000000.0
test util-16.1.17.13 {8.4 compatible formatting of doubles} \
    {expr 1e13} \
    10000000000000.0
test util-16.1.17.14 {8.4 compatible formatting of doubles} \
    {expr 1e14} \
    100000000000000.0
test util-16.1.17.15 {8.4 compatible formatting of doubles} \
    {expr 1e15} \
    1000000000000000.0
test util-16.1.17.16 {8.4 compatible formatting of doubles} \
    {expr 1e16} \
    10000000000000000.0
test util-16.1.17.17 {8.4 compatible formatting of doubles} \
    {expr 1e17} \
    1e+17
test util-16.1.17.18 {8.4 compatible formatting of doubles} \
    {expr 1e18} \
    1e+18
test util-16.1.17.19 {8.4 compatible formatting of doubles} \
    {expr 1e19} \
    1e+19
test util-16.1.17.20 {8.4 compatible formatting of doubles} \
    {expr 1e20} \
    1e+20
test util-16.1.17.21 {8.4 compatible formatting of doubles} \
    {expr 1e21} \
    1e+21
test util-16.1.17.22 {8.4 compatible formatting of doubles} \
    {expr 1e22} \
    1e+22
test util-16.1.17.23 {8.4 compatible formatting of doubles} \
    {expr 1e23} \
    9.9999999999999992e+22
test util-16.1.17.24 {8.4 compatible formatting of doubles} \
    {expr 1e24} \
    9.9999999999999998e+23
test util-16.1.17.25 {8.4 compatible formatting of doubles} \
    {expr 1e25} \
    1.0000000000000001e+25
test util-16.1.17.26 {8.4 compatible formatting of doubles} \
    {expr 1e26} \
    1e+26
test util-16.1.17.27 {8.4 compatible formatting of doubles} \
    {expr 1e27} \
    1e+27
test util-16.1.17.28 {8.4 compatible formatting of doubles} \
    {expr 1e28} \
    9.9999999999999996e+27
test util-16.1.17.29 {8.4 compatible formatting of doubles} \
    {expr 1e29} \
    9.9999999999999991e+28
test util-16.1.17.30 {8.4 compatible formatting of doubles} \
    {expr 1e30} \
    1e+30
test util-16.1.17.31 {8.4 compatible formatting of doubles} \
    {expr 1e31} \
    9.9999999999999996e+30
test util-16.1.17.32 {8.4 compatible formatting of doubles} \
    {expr 1e32} \
    1.0000000000000001e+32
test util-16.1.17.33 {8.4 compatible formatting of doubles} \
    {expr 1e33} \
    9.9999999999999995e+32
test util-16.1.17.34 {8.4 compatible formatting of doubles} \
    {expr 1e34} \
    9.9999999999999995e+33
test util-16.1.17.35 {8.4 compatible formatting of doubles} \
    {expr 1e35} \
    9.9999999999999997e+34
test util-16.1.17.36 {8.4 compatible formatting of doubles} \
    {expr 1e36} \
    1e+36
test util-16.1.17.37 {8.4 compatible formatting of doubles} \
    {expr 1e37} \
    9.9999999999999995e+36
test util-16.1.17.38 {8.4 compatible formatting of doubles} \
    {expr 1e38} \
    9.9999999999999998e+37
test util-16.1.17.39 {8.4 compatible formatting of doubles} \
    {expr 1e39} \
    9.9999999999999994e+38
test util-16.1.17.40 {8.4 compatible formatting of doubles} \
    {expr 1e40} \
    1e+40
test util-16.1.17.41 {8.4 compatible formatting of doubles} \
    {expr 1e41} \
    1e+41
test util-16.1.17.42 {8.4 compatible formatting of doubles} \
    {expr 1e42} \
    1e+42
test util-16.1.17.43 {8.4 compatible formatting of doubles} \
    {expr 1e43} \
    1e+43
test util-16.1.17.44 {8.4 compatible formatting of doubles} \
    {expr 1e44} \
    1.0000000000000001e+44
test util-16.1.17.45 {8.4 compatible formatting of doubles} \
    {expr 1e45} \
    9.9999999999999993e+44
test util-16.1.17.46 {8.4 compatible formatting of doubles} \
    {expr 1e46} \
    9.9999999999999999e+45
test util-16.1.17.47 {8.4 compatible formatting of doubles} \
    {expr 1e47} \
    1e+47
test util-16.1.17.48 {8.4 compatible formatting of doubles} \
    {expr 1e48} \
    1e+48
test util-16.1.17.49 {8.4 compatible formatting of doubles} \
    {expr 1e49} \
    9.9999999999999995e+48
test util-16.1.17.50 {8.4 compatible formatting of doubles} \
    {expr 1e50} \
    1.0000000000000001e+50
test util-16.1.17.51 {8.4 compatible formatting of doubles} \
    {expr 1e51} \
    9.9999999999999999e+50
test util-16.1.17.52 {8.4 compatible formatting of doubles} \
    {expr 1e52} \
    9.9999999999999999e+51
test util-16.1.17.53 {8.4 compatible formatting of doubles} \
    {expr 1e53} \
    9.9999999999999999e+52
test util-16.1.17.54 {8.4 compatible formatting of doubles} \
    {expr 1e54} \
    1.0000000000000001e+54
test util-16.1.17.55 {8.4 compatible formatting of doubles} \
    {expr 1e55} \
    1e+55
test util-16.1.17.56 {8.4 compatible formatting of doubles} \
    {expr 1e56} \
    1.0000000000000001e+56
test util-16.1.17.57 {8.4 compatible formatting of doubles} \
    {expr 1e57} \
    1e+57
test util-16.1.17.58 {8.4 compatible formatting of doubles} \
    {expr 1e58} \
    9.9999999999999994e+57
test util-16.1.17.59 {8.4 compatible formatting of doubles} \
    {expr 1e59} \
    9.9999999999999997e+58
test util-16.1.17.60 {8.4 compatible formatting of doubles} \
    {expr 1e60} \
    9.9999999999999995e+59
test util-16.1.17.61 {8.4 compatible formatting of doubles} \
    {expr 1e61} \
    9.9999999999999995e+60
test util-16.1.17.62 {8.4 compatible formatting of doubles} \
    {expr 1e62} \
    1e+62
test util-16.1.17.63 {8.4 compatible formatting of doubles} \
    {expr 1e63} \
    1.0000000000000001e+63
test util-16.1.17.64 {8.4 compatible formatting of doubles} \
    {expr 1e64} \
    1e+64
test util-16.1.17.65 {8.4 compatible formatting of doubles} \
    {expr 1e65} \
    9.9999999999999999e+64
test util-16.1.17.66 {8.4 compatible formatting of doubles} \
    {expr 1e66} \
    9.9999999999999995e+65
test util-16.1.17.67 {8.4 compatible formatting of doubles} \
    {expr 1e67} \
    9.9999999999999998e+66
test util-16.1.17.68 {8.4 compatible formatting of doubles} \
    {expr 1e68} \
    9.9999999999999995e+67
test util-16.1.17.69 {8.4 compatible formatting of doubles} \
    {expr 1e69} \
    1.0000000000000001e+69
test util-16.1.17.70 {8.4 compatible formatting of doubles} \
    {expr 1e70} \
    1.0000000000000001e+70
test util-16.1.17.71 {8.4 compatible formatting of doubles} \
    {expr 1e71} \
    1e+71
test util-16.1.17.72 {8.4 compatible formatting of doubles} \
    {expr 1e72} \
    9.9999999999999994e+71
test util-16.1.17.73 {8.4 compatible formatting of doubles} \
    {expr 1e73} \
    9.9999999999999998e+72
test util-16.1.17.74 {8.4 compatible formatting of doubles} \
    {expr 1e74} \
    9.9999999999999995e+73
test util-16.1.17.75 {8.4 compatible formatting of doubles} \
    {expr 1e75} \
    9.9999999999999993e+74
test util-16.1.17.76 {8.4 compatible formatting of doubles} \
    {expr 1e76} \
    1e+76
test util-16.1.17.77 {8.4 compatible formatting of doubles} \
    {expr 1e77} \
    9.9999999999999998e+76
test util-16.1.17.78 {8.4 compatible formatting of doubles} \
    {expr 1e78} \
    1e+78
test util-16.1.17.79 {8.4 compatible formatting of doubles} \
    {expr 1e79} \
    9.9999999999999997e+78
test util-16.1.17.80 {8.4 compatible formatting of doubles} \
    {expr 1e80} \
    1e+80
test util-16.1.17.81 {8.4 compatible formatting of doubles} \
    {expr 1e81} \
    9.9999999999999992e+80
test util-16.1.17.82 {8.4 compatible formatting of doubles} \
    {expr 1e82} \
    9.9999999999999996e+81
test util-16.1.17.83 {8.4 compatible formatting of doubles} \
    {expr 1e83} \
    1e+83
test util-16.1.17.84 {8.4 compatible formatting of doubles} \
    {expr 1e84} \
    1.0000000000000001e+84
test util-16.1.17.85 {8.4 compatible formatting of doubles} \
    {expr 1e85} \
    1e+85
test util-16.1.17.86 {8.4 compatible formatting of doubles} \
    {expr 1e86} \
    1e+86
test util-16.1.17.87 {8.4 compatible formatting of doubles} \
    {expr 1e87} \
    9.9999999999999996e+86
test util-16.1.17.88 {8.4 compatible formatting of doubles} \
    {expr 1e88} \
    9.9999999999999996e+87
test util-16.1.17.89 {8.4 compatible formatting of doubles} \
    {expr 1e89} \
    9.9999999999999999e+88
test util-16.1.17.90 {8.4 compatible formatting of doubles} \
    {expr 1e90} \
    9.9999999999999997e+89
test util-16.1.17.91 {8.4 compatible formatting of doubles} \
    {expr 1e91} \
    1.0000000000000001e+91
test util-16.1.17.92 {8.4 compatible formatting of doubles} \
    {expr 1e92} \
    1e+92
test util-16.1.17.93 {8.4 compatible formatting of doubles} \
    {expr 1e93} \
    1e+93
test util-16.1.17.94 {8.4 compatible formatting of doubles} \
    {expr 1e94} \
    1e+94
test util-16.1.17.95 {8.4 compatible formatting of doubles} \
    {expr 1e95} \
    1e+95
test util-16.1.17.96 {8.4 compatible formatting of doubles} \
    {expr 1e96} \
    1e+96
test util-16.1.17.97 {8.4 compatible formatting of doubles} \
    {expr 1e97} \
    1.0000000000000001e+97
test util-16.1.17.98 {8.4 compatible formatting of doubles} \
    {expr 1e98} \
    1e+98
test util-16.1.17.99 {8.4 compatible formatting of doubles} \
    {expr 1e99} \
    9.9999999999999997e+98
test util-16.1.17.100 {8.4 compatible formatting of doubles} \
    {expr 1e100} \
    1e+100
test util-16.1.17.101 {8.4 compatible formatting of doubles} \
    {expr 1e101} \
    9.9999999999999998e+100
test util-16.1.17.102 {8.4 compatible formatting of doubles} \
    {expr 1e102} \
    9.9999999999999998e+101
test util-16.1.17.103 {8.4 compatible formatting of doubles} \
    {expr 1e103} \
    1e+103
test util-16.1.17.104 {8.4 compatible formatting of doubles} \
    {expr 1e104} \
    1e+104
test util-16.1.17.105 {8.4 compatible formatting of doubles} \
    {expr 1e105} \
    9.9999999999999994e+104
test util-16.1.17.106 {8.4 compatible formatting of doubles} \
    {expr 1e106} \
    1.0000000000000001e+106
test util-16.1.17.107 {8.4 compatible formatting of doubles} \
    {expr 1e107} \
    9.9999999999999997e+106
test util-16.1.17.108 {8.4 compatible formatting of doubles} \
    {expr 1e108} \
    1e+108
test util-16.1.17.109 {8.4 compatible formatting of doubles} \
    {expr 1e109} \
    9.9999999999999998e+108
test util-16.1.17.110 {8.4 compatible formatting of doubles} \
    {expr 1e110} \
    1e+110
test util-16.1.17.111 {8.4 compatible formatting of doubles} \
    {expr 1e111} \
    9.9999999999999996e+110
test util-16.1.17.112 {8.4 compatible formatting of doubles} \
    {expr 1e112} \
    9.9999999999999993e+111
test util-16.1.17.113 {8.4 compatible formatting of doubles} \
    {expr 1e113} \
    1e+113
test util-16.1.17.114 {8.4 compatible formatting of doubles} \
    {expr 1e114} \
    1e+114
test util-16.1.17.115 {8.4 compatible formatting of doubles} \
    {expr 1e115} \
    1e+115
test util-16.1.17.116 {8.4 compatible formatting of doubles} \
    {expr 1e116} \
    1e+116
test util-16.1.17.117 {8.4 compatible formatting of doubles} \
    {expr 1e117} \
    1.0000000000000001e+117
test util-16.1.17.118 {8.4 compatible formatting of doubles} \
    {expr 1e118} \
    9.9999999999999997e+117
test util-16.1.17.119 {8.4 compatible formatting of doubles} \
    {expr 1e119} \
    9.9999999999999994e+118
test util-16.1.17.120 {8.4 compatible formatting of doubles} \
    {expr 1e120} \
    9.9999999999999998e+119
test util-16.1.17.121 {8.4 compatible formatting of doubles} \
    {expr 1e121} \
    1e+121
test util-16.1.17.122 {8.4 compatible formatting of doubles} \
    {expr 1e122} \
    1e+122
test util-16.1.17.123 {8.4 compatible formatting of doubles} \
    {expr 1e123} \
    9.9999999999999998e+122
test util-16.1.17.124 {8.4 compatible formatting of doubles} \
    {expr 1e124} \
    9.9999999999999995e+123
test util-16.1.17.125 {8.4 compatible formatting of doubles} \
    {expr 1e125} \
    9.9999999999999992e+124
test util-16.1.17.126 {8.4 compatible formatting of doubles} \
    {expr 1e126} \
    9.9999999999999992e+125
test util-16.1.17.127 {8.4 compatible formatting of doubles} \
    {expr 1e127} \
    9.9999999999999995e+126
test util-16.1.17.128 {8.4 compatible formatting of doubles} \
    {expr 1e128} \
    1.0000000000000001e+128
test util-16.1.17.129 {8.4 compatible formatting of doubles} \
    {expr 1e129} \
    1e+129
test util-16.1.17.130 {8.4 compatible formatting of doubles} \
    {expr 1e130} \
    1.0000000000000001e+130
test util-16.1.17.131 {8.4 compatible formatting of doubles} \
    {expr 1e131} \
    9.9999999999999991e+130
test util-16.1.17.132 {8.4 compatible formatting of doubles} \
    {expr 1e132} \
    9.9999999999999999e+131
test util-16.1.17.133 {8.4 compatible formatting of doubles} \
    {expr 1e133} \
    1e+133
test util-16.1.17.134 {8.4 compatible formatting of doubles} \
    {expr 1e134} \
    9.9999999999999992e+133
test util-16.1.17.135 {8.4 compatible formatting of doubles} \
    {expr 1e135} \
    9.9999999999999996e+134
test util-16.1.17.136 {8.4 compatible formatting of doubles} \
    {expr 1e136} \
    1.0000000000000001e+136
test util-16.1.17.137 {8.4 compatible formatting of doubles} \
    {expr 1e137} \
    1e+137
test util-16.1.17.138 {8.4 compatible formatting of doubles} \
    {expr 1e138} \
    1e+138
test util-16.1.17.139 {8.4 compatible formatting of doubles} \
    {expr 1e139} \
    1e+139
test util-16.1.17.140 {8.4 compatible formatting of doubles} \
    {expr 1e140} \
    1.0000000000000001e+140
test util-16.1.17.141 {8.4 compatible formatting of doubles} \
    {expr 1e141} \
    1e+141
test util-16.1.17.142 {8.4 compatible formatting of doubles} \
    {expr 1e142} \
    1.0000000000000001e+142
test util-16.1.17.143 {8.4 compatible formatting of doubles} \
    {expr 1e143} \
    1e+143
test util-16.1.17.144 {8.4 compatible formatting of doubles} \
    {expr 1e144} \
    1e+144
test util-16.1.17.145 {8.4 compatible formatting of doubles} \
    {expr 1e145} \
    9.9999999999999999e+144
test util-16.1.17.146 {8.4 compatible formatting of doubles} \
    {expr 1e146} \
    9.9999999999999993e+145
test util-16.1.17.147 {8.4 compatible formatting of doubles} \
    {expr 1e147} \
    9.9999999999999998e+146
test util-16.1.17.148 {8.4 compatible formatting of doubles} \
    {expr 1e148} \
    1e+148
test util-16.1.17.149 {8.4 compatible formatting of doubles} \
    {expr 1e149} \
    1e+149
test util-16.1.17.150 {8.4 compatible formatting of doubles} \
    {expr 1e150} \
    9.9999999999999998e+149
test util-16.1.17.151 {8.4 compatible formatting of doubles} \
    {expr 1e151} \
    1e+151
test util-16.1.17.152 {8.4 compatible formatting of doubles} \
    {expr 1e152} \
    1e+152
test util-16.1.17.153 {8.4 compatible formatting of doubles} \
    {expr 1e153} \
    1e+153
test util-16.1.17.154 {8.4 compatible formatting of doubles} \
    {expr 1e154} \
    1e+154
test util-16.1.17.155 {8.4 compatible formatting of doubles} \
    {expr 1e155} \
    1e+155
test util-16.1.17.156 {8.4 compatible formatting of doubles} \
    {expr 1e156} \
    9.9999999999999998e+155
test util-16.1.17.157 {8.4 compatible formatting of doubles} \
    {expr 1e157} \
    9.9999999999999998e+156
test util-16.1.17.158 {8.4 compatible formatting of doubles} \
    {expr 1e158} \
    9.9999999999999995e+157
test util-16.1.17.159 {8.4 compatible formatting of doubles} \
    {expr 1e159} \
    9.9999999999999993e+158
test util-16.1.17.160 {8.4 compatible formatting of doubles} \
    {expr 1e160} \
    1e+160
test util-16.1.17.161 {8.4 compatible formatting of doubles} \
    {expr 1e161} \
    1e+161
test util-16.1.17.162 {8.4 compatible formatting of doubles} \
    {expr 1e162} \
    9.9999999999999994e+161
test util-16.1.17.163 {8.4 compatible formatting of doubles} \
    {expr 1e163} \
    9.9999999999999994e+162
test util-16.1.17.164 {8.4 compatible formatting of doubles} \
    {expr 1e164} \
    1e+164
test util-16.1.17.165 {8.4 compatible formatting of doubles} \
    {expr 1e165} \
    9.999999999999999e+164
test util-16.1.17.166 {8.4 compatible formatting of doubles} \
    {expr 1e166} \
    9.9999999999999994e+165
test util-16.1.17.167 {8.4 compatible formatting of doubles} \
    {expr 1e167} \
    1e+167
test util-16.1.17.168 {8.4 compatible formatting of doubles} \
    {expr 1e168} \
    9.9999999999999993e+167
test util-16.1.17.169 {8.4 compatible formatting of doubles} \
    {expr 1e169} \
    9.9999999999999993e+168
test util-16.1.17.170 {8.4 compatible formatting of doubles} \
    {expr 1e170} \
    1e+170
test util-16.1.17.171 {8.4 compatible formatting of doubles} \
    {expr 1e171} \
    9.9999999999999995e+170
test util-16.1.17.172 {8.4 compatible formatting of doubles} \
    {expr 1e172} \
    1.0000000000000001e+172
test util-16.1.17.173 {8.4 compatible formatting of doubles} \
    {expr 1e173} \
    1e+173
test util-16.1.17.174 {8.4 compatible formatting of doubles} \
    {expr 1e174} \
    1.0000000000000001e+174
test util-16.1.17.175 {8.4 compatible formatting of doubles} \
    {expr 1e175} \
    9.9999999999999994e+174
test util-16.1.17.176 {8.4 compatible formatting of doubles} \
    {expr 1e176} \
    1e+176
test util-16.1.17.177 {8.4 compatible formatting of doubles} \
    {expr 1e177} \
    1e+177
test util-16.1.17.178 {8.4 compatible formatting of doubles} \
    {expr 1e178} \
    1.0000000000000001e+178
test util-16.1.17.179 {8.4 compatible formatting of doubles} \
    {expr 1e179} \
    9.9999999999999998e+178
test util-16.1.17.180 {8.4 compatible formatting of doubles} \
    {expr 1e180} \
    1e+180
test util-16.1.17.181 {8.4 compatible formatting of doubles} \
    {expr 1e181} \
    9.9999999999999992e+180
test util-16.1.17.182 {8.4 compatible formatting of doubles} \
    {expr 1e182} \
    1.0000000000000001e+182
test util-16.1.17.183 {8.4 compatible formatting of doubles} \
    {expr 1e183} \
    9.9999999999999995e+182
test util-16.1.17.184 {8.4 compatible formatting of doubles} \
    {expr 1e184} \
    1e+184
test util-16.1.17.185 {8.4 compatible formatting of doubles} \
    {expr 1e185} \
    9.9999999999999998e+184
test util-16.1.17.186 {8.4 compatible formatting of doubles} \
    {expr 1e186} \
    9.9999999999999998e+185
test util-16.1.17.187 {8.4 compatible formatting of doubles} \
    {expr 1e187} \
    9.9999999999999991e+186
test util-16.1.17.188 {8.4 compatible formatting of doubles} \
    {expr 1e188} \
    1e+188
test util-16.1.17.189 {8.4 compatible formatting of doubles} \
    {expr 1e189} \
    1e+189
test util-16.1.17.190 {8.4 compatible formatting of doubles} \
    {expr 1e190} \
    1.0000000000000001e+190
test util-16.1.17.191 {8.4 compatible formatting of doubles} \
    {expr 1e191} \
    1.0000000000000001e+191
test util-16.1.17.192 {8.4 compatible formatting of doubles} \
    {expr 1e192} \
    1e+192
test util-16.1.17.193 {8.4 compatible formatting of doubles} \
    {expr 1e193} \
    1.0000000000000001e+193
test util-16.1.17.194 {8.4 compatible formatting of doubles} \
    {expr 1e194} \
    9.9999999999999994e+193
test util-16.1.17.195 {8.4 compatible formatting of doubles} \
    {expr 1e195} \
    9.9999999999999998e+194
test util-16.1.17.196 {8.4 compatible formatting of doubles} \
    {expr 1e196} \
    9.9999999999999995e+195
test util-16.1.17.197 {8.4 compatible formatting of doubles} \
    {expr 1e197} \
    9.9999999999999995e+196
test util-16.1.17.198 {8.4 compatible formatting of doubles} \
    {expr 1e198} \
    1e+198
test util-16.1.17.199 {8.4 compatible formatting of doubles} \
    {expr 1e199} \
    1.0000000000000001e+199
test util-16.1.17.200 {8.4 compatible formatting of doubles} \
    {expr 1e200} \
    9.9999999999999997e+199
test util-16.1.17.201 {8.4 compatible formatting of doubles} \
    {expr 1e201} \
    1e+201
test util-16.1.17.202 {8.4 compatible formatting of doubles} \
    {expr 1e202} \
    9.999999999999999e+201
test util-16.1.17.203 {8.4 compatible formatting of doubles} \
    {expr 1e203} \
    9.9999999999999999e+202
test util-16.1.17.204 {8.4 compatible formatting of doubles} \
    {expr 1e204} \
    9.9999999999999999e+203
test util-16.1.17.205 {8.4 compatible formatting of doubles} \
    {expr 1e205} \
    1e+205
test util-16.1.17.206 {8.4 compatible formatting of doubles} \
    {expr 1e206} \
    1e+206
test util-16.1.17.207 {8.4 compatible formatting of doubles} \
    {expr 1e207} \
    1e+207
test util-16.1.17.208 {8.4 compatible formatting of doubles} \
    {expr 1e208} \
    9.9999999999999998e+207
test util-16.1.17.209 {8.4 compatible formatting of doubles} \
    {expr 1e209} \
    1.0000000000000001e+209
test util-16.1.17.210 {8.4 compatible formatting of doubles} \
    {expr 1e210} \
    9.9999999999999993e+209
test util-16.1.17.211 {8.4 compatible formatting of doubles} \
    {expr 1e211} \
    9.9999999999999996e+210
test util-16.1.17.212 {8.4 compatible formatting of doubles} \
    {expr 1e212} \
    9.9999999999999991e+211
test util-16.1.17.213 {8.4 compatible formatting of doubles} \
    {expr 1e213} \
    9.9999999999999998e+212
test util-16.1.17.214 {8.4 compatible formatting of doubles} \
    {expr 1e214} \
    9.9999999999999995e+213
test util-16.1.17.215 {8.4 compatible formatting of doubles} \
    {expr 1e215} \
    9.9999999999999991e+214
test util-16.1.17.216 {8.4 compatible formatting of doubles} \
    {expr 1e216} \
    1e+216
test util-16.1.17.217 {8.4 compatible formatting of doubles} \
    {expr 1e217} \
    9.9999999999999996e+216
test util-16.1.17.218 {8.4 compatible formatting of doubles} \
    {expr 1e218} \
    1.0000000000000001e+218
test util-16.1.17.219 {8.4 compatible formatting of doubles} \
    {expr 1e219} \
    9.9999999999999997e+218
test util-16.1.17.220 {8.4 compatible formatting of doubles} \
    {expr 1e220} \
    1e+220
test util-16.1.17.221 {8.4 compatible formatting of doubles} \
    {expr 1e221} \
    1e+221
test util-16.1.17.222 {8.4 compatible formatting of doubles} \
    {expr 1e222} \
    1e+222
test util-16.1.17.223 {8.4 compatible formatting of doubles} \
    {expr 1e223} \
    1e+223
test util-16.1.17.224 {8.4 compatible formatting of doubles} \
    {expr 1e224} \
    9.9999999999999997e+223
test util-16.1.17.225 {8.4 compatible formatting of doubles} \
    {expr 1e225} \
    9.9999999999999993e+224
test util-16.1.17.226 {8.4 compatible formatting of doubles} \
    {expr 1e226} \
    9.9999999999999996e+225
test util-16.1.17.227 {8.4 compatible formatting of doubles} \
    {expr 1e227} \
    1.0000000000000001e+227
test util-16.1.17.228 {8.4 compatible formatting of doubles} \
    {expr 1e228} \
    9.9999999999999992e+227
test util-16.1.17.229 {8.4 compatible formatting of doubles} \
    {expr 1e229} \
    9.9999999999999999e+228
test util-16.1.17.230 {8.4 compatible formatting of doubles} \
    {expr 1e230} \
    1.0000000000000001e+230
test util-16.1.17.231 {8.4 compatible formatting of doubles} \
    {expr 1e231} \
    1.0000000000000001e+231
test util-16.1.17.232 {8.4 compatible formatting of doubles} \
    {expr 1e232} \
    1.0000000000000001e+232
test util-16.1.17.233 {8.4 compatible formatting of doubles} \
    {expr 1e233} \
    9.9999999999999997e+232
test util-16.1.17.234 {8.4 compatible formatting of doubles} \
    {expr 1e234} \
    1e+234
test util-16.1.17.235 {8.4 compatible formatting of doubles} \
    {expr 1e235} \
    1.0000000000000001e+235
test util-16.1.17.236 {8.4 compatible formatting of doubles} \
    {expr 1e236} \
    1.0000000000000001e+236
test util-16.1.17.237 {8.4 compatible formatting of doubles} \
    {expr 1e237} \
    9.9999999999999994e+236
test util-16.1.17.238 {8.4 compatible formatting of doubles} \
    {expr 1e238} \
    1e+238
test util-16.1.17.239 {8.4 compatible formatting of doubles} \
    {expr 1e239} \
    9.9999999999999999e+238
test util-16.1.17.240 {8.4 compatible formatting of doubles} \
    {expr 1e240} \
    1e+240
test util-16.1.17.241 {8.4 compatible formatting of doubles} \
    {expr 1e241} \
    1.0000000000000001e+241
test util-16.1.17.242 {8.4 compatible formatting of doubles} \
    {expr 1e242} \
    1.0000000000000001e+242
test util-16.1.17.243 {8.4 compatible formatting of doubles} \
    {expr 1e243} \
    1.0000000000000001e+243
test util-16.1.17.244 {8.4 compatible formatting of doubles} \
    {expr 1e244} \
    1.0000000000000001e+244
test util-16.1.17.245 {8.4 compatible formatting of doubles} \
    {expr 1e245} \
    1e+245
test util-16.1.17.246 {8.4 compatible formatting of doubles} \
    {expr 1e246} \
    1.0000000000000001e+246
test util-16.1.17.247 {8.4 compatible formatting of doubles} \
    {expr 1e247} \
    9.9999999999999995e+246
test util-16.1.17.248 {8.4 compatible formatting of doubles} \
    {expr 1e248} \
    1e+248
test util-16.1.17.249 {8.4 compatible formatting of doubles} \
    {expr 1e249} \
    9.9999999999999992e+248
test util-16.1.17.250 {8.4 compatible formatting of doubles} \
    {expr 1e250} \
    9.9999999999999992e+249
test util-16.1.17.251 {8.4 compatible formatting of doubles} \
    {expr 1e251} \
    1e+251
test util-16.1.17.252 {8.4 compatible formatting of doubles} \
    {expr 1e252} \
    1.0000000000000001e+252
test util-16.1.17.253 {8.4 compatible formatting of doubles} \
    {expr 1e253} \
    9.9999999999999994e+252
test util-16.1.17.254 {8.4 compatible formatting of doubles} \
    {expr 1e254} \
    9.9999999999999994e+253
test util-16.1.17.255 {8.4 compatible formatting of doubles} \
    {expr 1e255} \
    9.9999999999999999e+254
test util-16.1.17.256 {8.4 compatible formatting of doubles} \
    {expr 1e256} \
    1e+256
test util-16.1.17.257 {8.4 compatible formatting of doubles} \
    {expr 1e257} \
    1e+257
test util-16.1.17.258 {8.4 compatible formatting of doubles} \
    {expr 1e258} \
    1.0000000000000001e+258
test util-16.1.17.259 {8.4 compatible formatting of doubles} \
    {expr 1e259} \
    9.9999999999999993e+258
test util-16.1.17.260 {8.4 compatible formatting of doubles} \
    {expr 1e260} \
    1.0000000000000001e+260
test util-16.1.17.261 {8.4 compatible formatting of doubles} \
    {expr 1e261} \
    9.9999999999999993e+260
test util-16.1.17.262 {8.4 compatible formatting of doubles} \
    {expr 1e262} \
    1e+262
test util-16.1.17.263 {8.4 compatible formatting of doubles} \
    {expr 1e263} \
    1e+263
test util-16.1.17.264 {8.4 compatible formatting of doubles} \
    {expr 1e264} \
    1e+264
test util-16.1.17.265 {8.4 compatible formatting of doubles} \
    {expr 1e265} \
    1.0000000000000001e+265
test util-16.1.17.266 {8.4 compatible formatting of doubles} \
    {expr 1e266} \
    1e+266
test util-16.1.17.267 {8.4 compatible formatting of doubles} \
    {expr 1e267} \
    9.9999999999999997e+266
test util-16.1.17.268 {8.4 compatible formatting of doubles} \
    {expr 1e268} \
    9.9999999999999997e+267
test util-16.1.17.269 {8.4 compatible formatting of doubles} \
    {expr 1e269} \
    1e+269
test util-16.1.17.270 {8.4 compatible formatting of doubles} \
    {expr 1e270} \
    1e+270
test util-16.1.17.271 {8.4 compatible formatting of doubles} \
    {expr 1e271} \
    9.9999999999999995e+270
test util-16.1.17.272 {8.4 compatible formatting of doubles} \
    {expr 1e272} \
    1.0000000000000001e+272
test util-16.1.17.273 {8.4 compatible formatting of doubles} \
    {expr 1e273} \
    9.9999999999999995e+272
test util-16.1.17.274 {8.4 compatible formatting of doubles} \
    {expr 1e274} \
    9.9999999999999992e+273
test util-16.1.17.275 {8.4 compatible formatting of doubles} \
    {expr 1e275} \
    9.9999999999999996e+274
test util-16.1.17.276 {8.4 compatible formatting of doubles} \
    {expr 1e276} \
    1.0000000000000001e+276
test util-16.1.17.277 {8.4 compatible formatting of doubles} \
    {expr 1e277} \
    1e+277
test util-16.1.17.278 {8.4 compatible formatting of doubles} \
    {expr 1e278} \
    9.9999999999999996e+277
test util-16.1.17.279 {8.4 compatible formatting of doubles} \
    {expr 1e279} \
    1.0000000000000001e+279
test util-16.1.17.280 {8.4 compatible formatting of doubles} \
    {expr 1e280} \
    1e+280
test util-16.1.17.281 {8.4 compatible formatting of doubles} \
    {expr 1e281} \
    1e+281
test util-16.1.17.282 {8.4 compatible formatting of doubles} \
    {expr 1e282} \
    1e+282
test util-16.1.17.283 {8.4 compatible formatting of doubles} \
    {expr 1e283} \
    9.9999999999999996e+282
test util-16.1.17.284 {8.4 compatible formatting of doubles} \
    {expr 1e284} \
    1.0000000000000001e+284
test util-16.1.17.285 {8.4 compatible formatting of doubles} \
    {expr 1e285} \
    9.9999999999999998e+284
test util-16.1.17.286 {8.4 compatible formatting of doubles} \
    {expr 1e286} \
    1e+286
test util-16.1.17.287 {8.4 compatible formatting of doubles} \
    {expr 1e287} \
    1.0000000000000001e+287
test util-16.1.17.288 {8.4 compatible formatting of doubles} \
    {expr 1e288} \
    1e+288
test util-16.1.17.289 {8.4 compatible formatting of doubles} \
    {expr 1e289} \
    1.0000000000000001e+289
test util-16.1.17.290 {8.4 compatible formatting of doubles} \
    {expr 1e290} \
    1.0000000000000001e+290
test util-16.1.17.291 {8.4 compatible formatting of doubles} \
    {expr 1e291} \
    9.9999999999999996e+290
test util-16.1.17.292 {8.4 compatible formatting of doubles} \
    {expr 1e292} \
    1e+292
test util-16.1.17.293 {8.4 compatible formatting of doubles} \
    {expr 1e293} \
    9.9999999999999992e+292
test util-16.1.17.294 {8.4 compatible formatting of doubles} \
    {expr 1e294} \
    1.0000000000000001e+294
test util-16.1.17.295 {8.4 compatible formatting of doubles} \
    {expr 1e295} \
    9.9999999999999998e+294
test util-16.1.17.296 {8.4 compatible formatting of doubles} \
    {expr 1e296} \
    9.9999999999999998e+295
test util-16.1.17.297 {8.4 compatible formatting of doubles} \
    {expr 1e297} \
    1e+297
test util-16.1.17.298 {8.4 compatible formatting of doubles} \
    {expr 1e298} \
    9.9999999999999996e+297
test util-16.1.17.299 {8.4 compatible formatting of doubles} \
    {expr 1e299} \
    1.0000000000000001e+299
test util-16.1.17.300 {8.4 compatible formatting of doubles} \
    {expr 1e300} \
    1.0000000000000001e+300
test util-16.1.17.301 {8.4 compatible formatting of doubles} \
    {expr 1e301} \
    1.0000000000000001e+301
test util-16.1.17.302 {8.4 compatible formatting of doubles} \
    {expr 1e302} \
    1.0000000000000001e+302
test util-16.1.17.303 {8.4 compatible formatting of doubles} \
    {expr 1e303} \
    1e+303
test util-16.1.17.304 {8.4 compatible formatting of doubles} \
    {expr 1e304} \
    9.9999999999999994e+303
test util-16.1.17.305 {8.4 compatible formatting of doubles} \
    {expr 1e305} \
    9.9999999999999994e+304
test util-16.1.17.306 {8.4 compatible formatting of doubles} \
    {expr 1e306} \
    1e+306
test util-16.1.17.307 {8.4 compatible formatting of doubles} \
    {expr 1e307} \
    9.9999999999999999e+306

test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} {
    set r {}
    foreach {input} {
	0x1ffffffffffffc000
	0x1ffffffffffffc800
	0x1ffffffffffffd000
	0x1ffffffffffffd800
................................................................................
    testprint "%I64d %td" 65536
} {65536 65536}

test util-18.12 {Tcl_ObjPrintf} {testprint} {
    testprint "%I64d %Id" 65537
} {65537 65537}

set ::tcl_precision $saved_precision

# cleanup
::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl
# End:






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<







381
382
383
384
385
386
387
































388
389
390
391
392
393
394












































395
396
397
398
399
400
401
....
2058
2059
2060
2061
2062
2063
2064













































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































2065
2066
2067
2068
2069
2070
2071
....
2135
2136
2137
2138
2139
2140
2141


2142
2143
2144
2145
2146
2147
2148
test util-5.50 {Tcl_StringMatch} {
    Wrapper_Tcl_StringMatch *. ""
} 0
test util-5.51 {Tcl_StringMatch} {
    Wrapper_Tcl_StringMatch "" ""
} 1

































test util-6.5 {Tcl_PrintDouble - make sure there's a decimal point} {
    concat x[expr 2.0]
} {x2.0}
test util-6.6 {Tcl_PrintDouble - make sure there's a decimal point} {
    concat x[expr 3.0e98]
} {x3e+98}













































# This test always succeeded in the C locale anyway...
test util-8.1 {TclNeedSpace - correct UTF8 handling} {
    # Bug 411825
    # Note that this test relies on the fact that
    # [interp target] calls on Tcl_AppendElement()
    # which calls on TclNeedSpace().  If [interp target]
    # is ever updated, this test will no longer test
................................................................................
    }
    -result 0x8010000000000000
    -cleanup {
	unset x
    }
}














































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































test util-17.1 {bankers' rounding [Bug 3349507]} {ieeeFloatingPoint} {
    set r {}
    foreach {input} {
	0x1ffffffffffffc000
	0x1ffffffffffffc800
	0x1ffffffffffffd000
	0x1ffffffffffffd800
................................................................................
    testprint "%I64d %td" 65536
} {65536 65536}

test util-18.12 {Tcl_ObjPrintf} {testprint} {
    testprint "%I64d %Id" 65537
} {65537 65537}



# cleanup
::tcltest::cleanupTests
return

# Local Variables:
# mode: tcl
# End: