summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2025-04-17 17:30:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2025-04-17 17:30:26 (GMT)
commit9d702a3135cb699411125ddd50d9403ae116d688 (patch)
tree84212c147cdc5301649eb26ea08caf34bbf25978 /generic/tclStrToD.c
parent3fcc1a8bb27b0aa2385c974ed779bec529bcdfc0 (diff)
downloadtcl-9d702a3135cb699411125ddd50d9403ae116d688.zip
tcl-9d702a3135cb699411125ddd50d9403ae116d688.tar.gz
tcl-9d702a3135cb699411125ddd50d9403ae116d688.tar.bz2
The callers of TclLog2() needed its range to be limited to [0..31].
RequiredPrecision needs support for the full long long range. Create a new utility routine TclMSB() to provide the functionality without truncated range. Use it. Put it internal stubs anticipating testing.
Diffstat (limited to 'generic/tclStrToD.c')
-rw-r--r--generic/tclStrToD.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 3faadb1..3a81615 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -2312,7 +2312,7 @@ RequiredPrecision(
{
/* assert(sizeof(Tcl_WideUInt) <= sizeof(long long)) */
- return w ? 1 + TclLog2((long long) w) : 0;
+ return w ? 1 + TclMSB((unsigned long long) w) : 0;
}
/*