diff options
author | Kevin B Kenny <kennykb@acm.org> | 2010-11-28 23:20:10 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2010-11-28 23:20:10 (GMT) |
commit | a5a72404b019601daeadb7184189dd40ef6ac90c (patch) | |
tree | 87833950b8671a111d7d2e3d6ba8194c7359cb36 /generic/tclInt.h | |
parent | abe7eadae6ebae4c2827f9314f7d81af9dfff916 (diff) | |
download | tcl-a5a72404b019601daeadb7184189dd40ef6ac90c.zip tcl-a5a72404b019601daeadb7184189dd40ef6ac90c.tar.gz tcl-a5a72404b019601daeadb7184189dd40ef6ac90c.tar.bz2 |
2010-11-29 Kevin B. Kenny <kennykb@acm.org>
* generic/tclInt.decls:
* generic/tclInt.h:
* generic/tclStrToD.c:
* generic/tclTest.c:
* generic/tclTomMath.decls:
* generic/tclUtil.c:
* tests/util.test:
* unix/Makefile.in:
* win/Makefile.in:
* win/makefile.vc: Rewrite of Tcl_PrintDouble and TclDoubleDigits
that (a) fixes a severe performance problem with floating point
shimmering reported by Karl Lehenbauer, (b) allows TclDoubleDigits
to generate the digit strings for 'e' and 'f' format, so that it
can be used for tcl_precision != 0 (and possibly later for [format]),
(c) fixes [Bug 3120139] by making TclPrintDouble inherently
locale-independent, (d) adds test cases to util.test for
correct rounding in difficult cases of TclDoubleDigits where fixed-
precision results are requested. (e) adds test cases to util.test for
the controversial aspects of [Bug 3105247]. As a side effect, two
more modules from libtommath (bn_mp_set_int.c and bn_mp_init_set_int.c)
are brought into the build, since the new code uses them.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 218c40b..8c5d863 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.486 2010/11/15 21:34:54 andreas_kupries Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.487 2010/11/28 23:20:11 kennykb Exp $ */ #ifndef _TCLINT @@ -2795,6 +2795,32 @@ struct Tcl_LoadHandle_ { /* Procedure that unloads a loaded module */ }; +/* Flags for conversion of doubles to digit strings */ + +#define TCL_DD_SHORTEST 0x4 + /* Use the shortest possible string */ +#define TCL_DD_STEELE 0x5 + /* Use the original Steele&White algorithm */ +#define TCL_DD_E_FORMAT 0x2 + /* Use a fixed-length string of digits, + * suitable for E format*/ +#define TCL_DD_F_FORMAT 0x3 + /* Use a fixed number of digits after the + * decimal point, suitable for F format */ + +#define TCL_DD_SHORTEN_FLAG 0x4 + /* Allow return of a shorter digit string + * if it converts losslessly */ +#define TCL_DD_NO_QUICK 0x8 + /* Debug flag: forbid quick FP conversion */ + +#define TCL_DD_CONVERSION_TYPE_MASK 0x3 + /* Mask to isolate the conversion type */ +#define TCL_DD_STEELE0 0x1 + /* 'Steele&White' after masking */ +#define TCL_DD_SHORTEST0 0x0 + /* 'Shortest possible' after masking */ + /* *---------------------------------------------------------------- * Procedures shared among Tcl modules but not used by the outside world: @@ -2843,7 +2869,6 @@ MODULE_SCOPE void TclContinuationsEnterDerived(Tcl_Obj *objPtr, MODULE_SCOPE ContLineLoc *TclContinuationsGet(Tcl_Obj *objPtr); MODULE_SCOPE void TclContinuationsCopy(Tcl_Obj *objPtr, Tcl_Obj *originObjPtr); -MODULE_SCOPE int TclDoubleDigits(char *buf, double value, int *signum); MODULE_SCOPE void TclDeleteNamespaceVars(Namespace *nsPtr); /* TIP #280 - Modified token based evulation, with line information. */ MODULE_SCOPE int TclEvalEx(Tcl_Interp *interp, const char *script, |