RE: RE: Floating point math is the devil!
You are viewing a single comment's thread from:

RE: Floating point math is the devil!

Words
33
Reading
1 min
Listen
Play
5y

made me wonder what my fav language would handle this..

marc@vishnu ~> tclsh
% proc myAdd x {
expr { $x * 125 }
}
% myAdd 0.001
0.125
% myAdd 0.00000001
1.25e-6

tcl returned value in scientific notation to be correct, would cause formatting errors, no calc errors.

i love programming, have fun, keep light.

@klevn: made me wonder | Ecency