[#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:23284] [Bug #1397] to_f of rational

From: Karl Brodowsky <redmine@...>
Date: 2009-04-22 10:36:08 UTC
List: ruby-core #23284
Bug #1397: to_f of rational
http://redmine.ruby-lang.org/issues/show/1397

Author: Karl Brodowsky
Status: Open, Priority: Normal
Category: core, Target version: Ruby 1.8.8
ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]

irb
irb(main):001:0> require "rational"
=> true
irb(main):002:0> a=10**309
=> 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
irb(main):003:0> b=a+1
=> 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
irb(main):004:0> c=Rational(a,b)
=> Rational(1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)
irb(main):005:0> c.to_f
/usr/local/lib/ruby/1.8/rational.rb:390: warning: Bignum out of Float range
/usr/local/lib/ruby/1.8/rational.rb:390: warning: Bignum out of Float range
=> NaN


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

In This Thread

Prev Next