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/tclTomMathDecls.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/tclTomMathDecls.h')
-rw-r--r-- | generic/tclTomMathDecls.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index 61e9c07..4e55ce1 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTomMathDecls.h,v 1.13 2010/08/19 04:26:04 nijtmans Exp $ + * RCS: @(#) $Id: tclTomMathDecls.h,v 1.14 2010/11/28 23:20:11 kennykb Exp $ */ #ifndef _TCLTOMMATHDECLS @@ -79,6 +79,7 @@ #define mp_init_copy TclBN_mp_init_copy #define mp_init_multi TclBN_mp_init_multi #define mp_init_set TclBN_mp_init_set +#define mp_init_set_int TclBN_mp_init_set_int #define mp_init_size TclBN_mp_init_size #define mp_karatsuba_mul TclBN_mp_karatsuba_mul #define mp_karatsuba_sqr TclBN_mp_karatsuba_sqr @@ -96,6 +97,7 @@ #define mp_rshd TclBN_mp_rshd #define mp_s_rmap TclBNMpSRmap #define mp_set TclBN_mp_set +#define mp_set_int TclBN_mp_set_int #define mp_shrink TclBN_mp_shrink #define mp_sqr TclBN_mp_sqr #define mp_sqrt TclBN_mp_sqrt @@ -268,6 +270,10 @@ EXTERN int TclBN_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, EXTERN int TclBN_s_mp_sqr(mp_int *a, mp_int *b); /* 60 */ EXTERN int TclBN_s_mp_sub(mp_int *a, mp_int *b, 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); typedef struct TclTomMathStubs { int magic; @@ -334,6 +340,8 @@ typedef struct TclTomMathStubs { int (*tclBN_s_mp_mul_digs) (mp_int *a, mp_int *b, mp_int *c, int digs); /* 58 */ int (*tclBN_s_mp_sqr) (mp_int *a, mp_int *b); /* 59 */ int (*tclBN_s_mp_sub) (mp_int *a, 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 */ } TclTomMathStubs; #ifdef __cplusplus @@ -472,6 +480,10 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; (tclTomMathStubsPtr->tclBN_s_mp_sqr) /* 59 */ #define TclBN_s_mp_sub \ (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 */ #endif /* defined(USE_TCL_STUBS) */ |