Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-05-11
02:09 • Closed ticket [523537ffff]: expr, string is double disagree plus 7 other... artifact: 5649d125a3 user: kennykb
2005-03-16
23:41 • Ticket [523537ffff]: 5 changes artifact: 1d5c567712 user: dgp
2004-07-13
21:22 • Ticket [523537ffff]: 4 changes artifact: 99be62f227 user: dgp
2002-06-07
21:19 • Ticket [523537ffff]: 5 changes artifact: 6cc392050f user: dgp
06:12 • Ticket [523537ffff]: 4 changes artifact: 6fda99cd11 user: mdejong
2002-02-27
19:05 • New ticket [523537ffff]. artifact: 6d66cf06b0 user: dgp

[expr], [string is double] disagree

Closed / Fixed523537ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 22 years ago
Descriptionplain2002-02-27 19:05:32
% set a 1.5
1.5
% set b 0x1.8p0
0x1.8p0
% expr {$a == $b}
0
% lsort -real [list $a $b]
1.5 0x1.8p0
% expr {$a == $b}
1
% expr {$a + 0}
1.5
% expr {$b + 0}
can't use non-numeric string as operand of "+"
% string is double $a
1
% string is double $b
1

At issue is whether or not "hexadecimal
floating-point literals" are recognized
by Tcl as valid floating point values.

As more C libraries become C99 compliant, their
strtod() will recognize these, but other parts
of Tcl do not.  Tcl should make one choice or
the other and be consistent about it.

One answer would be to force pre-C99 behavior
by detecting C99 behavior with configure and
linking in compat/strtod.c if it is found.
mdejongplain2002-06-07 06:12:32
Logged In: YES 
user_id=90858

Umm, I am not really sure what to do about this
one. Does someone else want to take the lead on
this?
dgpplain2002-06-07 21:19:24
Logged In: YES 
user_id=80530

I'll take it.  Will assign it back when I have a patch
for you to evaluate.
dgpplain2004-07-13 21:22:08
Logged In: YES 
user_id=80530

See TIP 132.
dgpplain2005-03-16 23:41:49
Logged In: YES 
user_id=80530

confirmed the candidate
TIP 132 implementation fixes
this bug.  Assign to kennykb
for closing when TIP 132 goes
final.
kennykbplain2005-05-11 02:09:22
Logged In: YES 
user_id=99768

TIP #132 now final; closing the bug.
Log in (anonymous is fine) to add a comment.