|
2004-07-04
| ||
| 05:13 | • Ticket [908375ffff] round() doesn't support numbers larger than 31 bits ... artifact: fe43c836f6 user: msofer | |
| 04:36 | • Closed ticket [908375ffff]. artifact: d00b403b05 user: msofer | |
|
2004-07-03
| ||
| 05:13 | • Ticket [908375ffff]: 4 changes artifact: 96df36039a user: dkf | |
| 05:01 | • Ticket [908375ffff]: 4 changes artifact: 33396edbbe user: dkf | |
| 04:53 | • Ticket [908375ffff]: 5 changes artifact: ee1b40fbb5 user: msofer | |
| 04:53 | • Add attachment wideRound2.patch to ticket [908375ffff] artifact: 5c1355c096 user: msofer | |
|
2004-05-30
| ||
| 19:36 | • Ticket [908375ffff] round() doesn't support numbers larger than 31 bits ... artifact: c6e8a5d955 user: dkf | |
|
2004-03-31
| ||
| 03:07 | • Ticket [908375ffff]: 4 changes artifact: a798af8a42 user: hemanglavana | |
|
2004-03-30
| ||
| 05:04 | • Add attachment wideRound.patch to ticket [908375ffff] artifact: 0b413441d7 user: dkf | |
| 05:04 | • Ticket [908375ffff] round() doesn't support numbers larger than 31 bits ... artifact: 197accc175 user: dkf | |
|
2004-03-05
| ||
| 22:23 | • Ticket [908375ffff]: 4 changes artifact: 89b8914d69 user: hemanglavana | |
|
2004-03-02
| ||
| 23:40 | • Ticket [908375ffff]: 6 changes artifact: 7c67e25670 user: dkf | |
| 15:39 | • New ticket [908375ffff]. artifact: b05aa7a3a3 user: hemanglavana | |
round() doesn't support numbers larger than 31 bits
Closed / Fixed908375ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 22 years ago
Descriptionplain2004-03-02 15:39:49
This was just reported by one of our users today. It
seems that round() doesn't seem to handle numbers
larger than 31 bits:
godel:49> /tmp/hlavana/tcltk/bin/tclsh8.4
% info patch
8.4.6
% expr round( 2147483647.1 )
2147483647
% expr round( 2147483648.1 )
integer value too large to represent
% expr {2147483648+1}
2147483649
% exit
godel:50>
If this is a bug, would it be possible to get it fixed
for tcl8.4.6 or is it too late now?
dkfplain2004-03-02 23:40:16
Logged In: YES user_id=79902 It's too late for 8.4.6 as we've already got a release candidate out for distribution testing (or whatever the proper term is.) With any change we'd have to start the whole release process over again. Sorry. :^( I'll make this a high prio fix for 8.5a1 though and backport to the 8.4 branch.
hemanglavanaplain2004-03-05 22:23:02
Logged In: YES user_id=81875 The current workaround for this issue is to use the wide() and add 0.5 to the number for rounding: hlavana-u5:81> tclsh % expr wide(2147483648.1) 2147483648 % expr wide(2147483648.9) 2147483648 % expr wide(2147483648.9+0.5) 2147483649 % expr wide(2147483648.1+0.5) 2147483648 %
dkfplain2004-03-30 05:04:12
File Added - 81829: wideRound.patch Logged In: YES user_id=79902 Try this patch. The downside is that the result from round() will normally be a wide now.
hemanglavanaplain2004-03-31 03:07:27
Logged In: YES user_id=81875 The patch seems to work fine: godel:148> /tmp/hlavana/tcltk/bin/tclsh8.5 % info patch 8.5a2 % expr round( 2147483648.1 ) 2147483648 % expr round( 2147483648.9 ) 2147483649 % exit godel:149> I don't see the result of round() as wide to be an issue. -- thanks
dkfplain2004-05-30 19:36:49
Logged In: YES user_id=79902 Please review this and apply the patch if you think it is not too semantics-damaging.
msoferplain2004-07-03 04:53:57
File Added - 92706: wideRound2.patch Logged In: YES user_id=148712 I do not like coercing all results of 'round' to wide; attached a patch that only does this when necessary. Your turn :)
dkfplain2004-07-03 05:01:37
Logged In: YES user_id=79902 I don't know what answer anyone expects out of round() in the first place. :/ So long as we have a consistent story, I don't really care.
dkfplain2004-07-03 05:13:21
Logged In: YES user_id=79902 I suppose if we restrict ourselves to just producing wides in the case where we would have failed previously, we'll be monotonically improving things...
msoferplain2004-07-04 04:36:58
Logged In: YES user_id=148712 Fixed in HEAD; should I backport to core-8-4-branch?
msoferplain2004-07-04 05:13:29
Logged In: YES user_id=148712 Backported.
Log in (anonymous is fine) to add a comment.
Attachments:
- wideRound2.patch [download] added by msofer on 2004-07-03 04:53:57. [details]
- wideRound.patch [download] added by dkf on 2004-03-30 05:04:12. [details]