[#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:23198] [Bug #1336] Change in string representation of Floats

From: Roger Pack <redmine@...>
Date: 2009-04-14 04:45:42 UTC
List: ruby-core #23198
Issue #1336 has been updated by Roger Pack.


currently (for curiosity sake) trunk does:

>> [1,2,3].to_s
=> "[1, 2, 3]"
>> [1,2,3].inspect
=> "[1, 2, 3]"

>> -0.9
=> -0.9
>> 2.1-3.0
=> -0.8999999999999999
>> 2.1-3.0+0.9
=> 1.1102230246251565e-16
>> 1.9-0.9
=> 0.9999999999999999

I'd personally be all right with how it is now or with having .to_s round and .inspect either (not round or behave like .to_s does currently).  As long as somehow or other users are alerted to that fact that "1.9-0.9 ain't one" (a fact slightly obscured previously).
Thanks.
-=r
----------------------------------------
http://redmine.ruby-lang.org/issues/show/1336

----------------------------------------
http://redmine.ruby-lang.org

In This Thread