summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2023-01-22 02:02:37 (GMT)
committerKevin B Kenny <kennykb@acm.org>2023-01-22 02:02:37 (GMT)
commit2b516939bd2d4aae1f1b2b8c561419146d99c978 (patch)
tree08bf419bd407d5ed5501422766eeaeed7b6fa17b /generic/tclStrToD.c
parent1c6b1c9e6cfa728758ecf5c6172af85ca2d3a93c (diff)
parent47b385e3dbb2e889faecefcaf7c29685b7879411 (diff)
downloadtcl-2b516939bd2d4aae1f1b2b8c561419146d99c978.zip
tcl-2b516939bd2d4aae1f1b2b8c561419146d99c978.tar.gz
tcl-2b516939bd2d4aae1f1b2b8c561419146d99c978.tar.bz2
Merge 8.7 (Bug [e3dcab1d14])
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r--generic/tclStrToD.c61
1 files changed, 31 insertions, 30 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index fed2aea..597fe77 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -261,34 +261,35 @@ static const int log2pow5[27] = {
};
#define N_LOG2POW5 27
-static const Tcl_WideUInt wuipow5[27] = {
- (Tcl_WideUInt) 1, /* 5**0 */
- (Tcl_WideUInt) 5,
- (Tcl_WideUInt) 25,
- (Tcl_WideUInt) 125,
- (Tcl_WideUInt) 625,
- (Tcl_WideUInt) 3125, /* 5**5 */
- (Tcl_WideUInt) 3125*5,
- (Tcl_WideUInt) 3125*25,
- (Tcl_WideUInt) 3125*125,
- (Tcl_WideUInt) 3125*625,
- (Tcl_WideUInt) 3125*3125, /* 5**10 */
- (Tcl_WideUInt) 3125*3125*5,
- (Tcl_WideUInt) 3125*3125*25,
- (Tcl_WideUInt) 3125*3125*125,
- (Tcl_WideUInt) 3125*3125*625,
- (Tcl_WideUInt) 3125*3125*3125, /* 5**15 */
- (Tcl_WideUInt) 3125*3125*3125*5,
- (Tcl_WideUInt) 3125*3125*3125*25,
- (Tcl_WideUInt) 3125*3125*3125*125,
- (Tcl_WideUInt) 3125*3125*3125*625,
- (Tcl_WideUInt) 3125*3125*3125*3125, /* 5**20 */
- (Tcl_WideUInt) 3125*3125*3125*3125*5,
- (Tcl_WideUInt) 3125*3125*3125*3125*25,
- (Tcl_WideUInt) 3125*3125*3125*3125*125,
- (Tcl_WideUInt) 3125*3125*3125*3125*625,
- (Tcl_WideUInt) 3125*3125*3125*3125*3125, /* 5**25 */
- (Tcl_WideUInt) 3125*3125*3125*3125*3125*5 /* 5**26 */
+static const Tcl_WideUInt wuipow5[] = {
+ (Tcl_WideUInt) 1U, /* 5**0 */
+ (Tcl_WideUInt) 5U,
+ (Tcl_WideUInt) 25U,
+ (Tcl_WideUInt) 125U,
+ (Tcl_WideUInt) 625U,
+ (Tcl_WideUInt) 3125U, /* 5**5 */
+ (Tcl_WideUInt) 3125U*5U,
+ (Tcl_WideUInt) 3125U*25U,
+ (Tcl_WideUInt) 3125U*125U,
+ (Tcl_WideUInt) 3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U, /* 5**10 */
+ (Tcl_WideUInt) 3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*25U,
+ (Tcl_WideUInt) 3125U*3125U*125U,
+ (Tcl_WideUInt) 3125U*3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U*3125U, /* 5**15 */
+ (Tcl_WideUInt) 3125U*3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*25U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*125U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U, /* 5**20 */
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*25U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*125U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*625U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*3125U, /* 5**25 */
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*3125U*5U,
+ (Tcl_WideUInt) 3125U*3125U*3125U*3125U*3125U*25U /* 5**27 */
};
/*
@@ -4484,7 +4485,7 @@ TclDoubleDigits(
++m2plus;
}
- if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] <= 64) {
+ if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] < 64) {
/*
* If 10*2**s2*5**s5 == 2**(s2+1)+5**(s5+1) fits in a 64-bit word,
* then all our intermediate calculations can be done using exact
@@ -4541,7 +4542,7 @@ TclDoubleDigits(
s2 -= b2; b2 = 0;
}
- if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] <= 64) {
+ if (s5+1 < N_LOG2POW5 && s2+1 + log2pow5[s5+1] < 64) {
/*
* If 10*2**s2*5**s5 == 2**(s2+1)+5**(s5+1) fits in a 64-bit word,
* then all our intermediate calculations can be done using exact