diff options
| author | dgp <dgp@users.sourceforge.net> | 2025-04-16 19:26:34 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2025-04-16 19:26:34 (GMT) |
| commit | 74dd7b71b703ffec899af092b97af8235ea47831 (patch) | |
| tree | 4e2fcc28c66ebc9d9c8c768a70afc32ea34b95a5 /generic/tclStrToD.c | |
| parent | 2cf3949e322cb1f5644049c1de17577f6e564a2d (diff) | |
| download | tcl-74dd7b71b703ffec899af092b97af8235ea47831.zip tcl-74dd7b71b703ffec899af092b97af8235ea47831.tar.gz tcl-74dd7b71b703ffec899af092b97af8235ea47831.tar.bz2 | |
The routine RequiredPrecision() is just a variation on the same function
provided by TclLog2(). Re-implement as a simple wrapper.
Diffstat (limited to 'generic/tclStrToD.c')
| -rw-r--r-- | generic/tclStrToD.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 1d7fa40..3a6470e 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -2313,6 +2313,13 @@ RequiredPrecision( int rv; unsigned int wi; + if (sizeof(Tcl_WideUInt) <= sizeof(long long)) { + return 1 + ( w ? TclLog2((long long) w) : 0); + } + + /* TODO: Are there any circumstances where we will continue + * to the alternative below? */ + if (w & ((Tcl_WideUInt)0xFFFFFFFF << 32)) { wi = (unsigned int)(w >> 32); rv = 32; } else { |
