ruby-core

Mailing list archive

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

From: Brent Roman <brent@...>
Date: 2009-04-11 18:53:12 UTC
List: ruby-core #23181
I'd prefer that Float#to_s => rounded, Float#inspect => non rounded
(i.e. 0.9.inspect => "0.8999999999")

- brent


Sakuro OZAWA wrote:
> 
> Issue #1336 has been updated by Roger Pack.
> 
> 
> I like the recent change.  Now it acts like this:
> 
>>> 0.9
> => 0.9
>>>  2.1 - 3.0
> => -0.8999999999999999
>>> (2.1-3.0) == -0.9
> => false
> 
> Is this satisfactory, or would anyone still prefer Float#to_s => rounded,
> Float#inspect => non rounded (i.e. 0.9.inspect => "0.8999999999")?  Just
> wondering since I brought up this mess :)
> I kind of like the current way.  It hides some complexity while still
> explaining to end users why equality fails.
> Thanks for the update.
> 
> -=r
> ----------------------------------------
> http://redmine.ruby-lang.org/issues/show/1336
> 
> ----------------------------------------
> http://redmine.ruby-lang.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-ruby-core%3A23075---Bug--1336--Change-in-string-representation-of-Floats-tp22798535p23004293.html
Sent from the ruby-core mailing list archive at Nabble.com.


In This Thread