L
LAMBEAU Bernard
[Note: parts of this message were removed to make it a legal post.]
We all know that finite representation comes with some difficulties...
but...
x = 45.0*(Math:I / 180.0)
y = 0.785398163397448
puts "#{x.class} : #{x}"
puts "#{y.class} : #{y}"
puts 45.0*(Math:I / 180.0) == 0.785398163397448
prints
Float : 0.785398163397448
Float : 0.785398163397448
false
Does to_s show something less precise than the internal representation of
Floats?
thx
Bernard
We all know that finite representation comes with some difficulties...
but...
x = 45.0*(Math:I / 180.0)
y = 0.785398163397448
puts "#{x.class} : #{x}"
puts "#{y.class} : #{y}"
puts 45.0*(Math:I / 180.0) == 0.785398163397448
prints
Float : 0.785398163397448
Float : 0.785398163397448
false
Does to_s show something less precise than the internal representation of
Floats?
thx
Bernard