Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3223 pow(2,50) shouldn't be euqal to pow(2,52)

obsolete: 8.5a3
closed-fixed
miguel sofer
5
2005-08-24
2005-08-24
Ulrich Ring
No

# use tcl8.5.a3 and evaluate the following

# we all agree: pow(2,50) is not equal to pow(2,52):
puts [expr pow(2,50) == pow(2,52)] ;# returns 0

# but if everything is a string it may happen
puts [string equal [expr pow(2,50)] [expr pow(2,52)]]
,# returns 1

-----

the trouble seems to come up with power >=52.

each 2^^i is equal to 2^^(i-2), if i >= 52,

- and if the value converted to a string
- and if tcl_precision == 0

Discussion

  • Kevin B KENNY
    Kevin B KENNY
    2005-08-24

    • status: open --> closed-fixed