Overview
| Artifact ID: | 762a0e6e92814da130cfa8842e1a4dc6d1d7e4df |
|---|---|
| Ticket: | 1003145fffffffffffffffffffffffffffffffff
expr int operation giving different results for same values |
| User & Date: | s_a_white on 2004-08-04 09:55:09 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Perhaps related to bug 866469? Preferred after int conversion a consistant output on all operations, preferrably giving the same results as C for a similar double to int conversion. Test: proc test { val } { set scaling 100 puts "\t$val" set out [expr { $val * $scaling }] puts "\t$out" set out [expr { int($out) }] puts "\t$out" return $out } puts "test1:" set a "999996.0" puts "\t$a" puts "\t[expr { int($a) }]" puts "test2:" set a 9999.96 puts "\t$a" set a [expr { $a * 100.0 }] puts "\t$a" puts "\t[expr { int($a) }]" puts "test3:" set a 9999.96 puts "\t$a" set a [expr { $a * 100 }] puts "\t$a" puts "\t[expr { int($a) }]" puts "test4:" puts "\t[test 9999.96]" Results: test1: 999996.0 999996 test2: 9999.96 999996.0 999995 test3: 9999.96 999996.0 999995 test4: 9999.96 999996.0 999995 999995 C result is always 999996 for the provided double value. - foundin changed to: "obsolete: 8.4.5"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "s_a_white"
- subsystem changed to: "None"
- title changed to:
expr int operation giving different results for same values
- type changed to: "Bug"