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

From: Gary Wright <gwtmp01@...>
Date: 2009-04-17 19:17:56 UTC
List: ruby-core #23240
On Apr 17, 2009, at 12:21 AM, Ondrej Bilka wrote:
>>
> I can test normaly.
> irb(main):019:0> x=1.0/0
> => Infinity
> irb(main):020:0> y=-1.0/0
> => -Infinity
> irb(main):021:0> x==y
> => false

Well now you are creating a instance of -Infinity or Infinity in order  
to determine if another instance is equal to -Infinity or Infinity.

It is like suggesting that we don't need Fixnum#zero? or a literal 0,  
because you can always do:

def zero?
   self == (42 - 42)
end

Without a literal value for -Infinity or Infinity you have to  
construct the value before you can do the comparison--which was my  
poorly worded point.  You shouldn't have to construct the value for  
the comparison.  I was also suggesting that the tests, no matter how  
implemented, should be part of Float:

Float#negative_infinity?
Float#infinity?
Float#negative_zero?

Gary Wright




In This Thread

Prev Next