[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>

Dear Ruby developers and users!

8 messages 2009/04/17

[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>

Feature #1408: 0.1.to_r not equal to (1/10)

19 messages 2009/04/26

[ruby-core:23199] Re: [Bug #1336] Change in string representation of Floats

From: Yukihiro Matsumoto <matz@...>
Date: 2009-04-14 05:05:19 UTC
List: ruby-core #23199
Hi,

In message "Re: [ruby-core:23189] Re: [Bug #1336] Change in string representation of Floats"
    on Mon, 13 Apr 2009 13:12:13 +0900, Brent Roman <brent@mbari.org> writes:
|
|What does the current trunk output for (2.1-3.0).to_s  ?

"-0.8999999999999999"

|Consider that (here at least):
|2.1-3.0+0.9 ==  1.110223024625156540e-16
|
|I'd like to be proven wrong, but I currently believe that the one cannot
|create a human friendly Float string conversion that is also a regenerating
|representation.

I agree with it.  My opinion is that IF we need to get regenerating
string representation, we need a method dedicated to the purpose
(e.g. dump).  I am not yet convinced we need such method.

And the current situation is #to_s and #inspect for floats share the
implementation, so both methods give same representation.

The reason for the change (increased precision) was too many people do
not understand the nature of floating point values on computers, and
fall in error traps by illusion partly emphasized by dropping
precision in string representations.

							matz.

In This Thread