[Ironruby-core] Kernel#puts and Kernel#print with NaN and Infinity values

Tomas Matousek Tomas.Matousek at microsoft.com
Tue Jan 6 11:07:44 EST 2009


Yes, could you please file it?

Thanks,
Tomas

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Daniele Alessandri
Sent: Tuesday, January 06, 2009 7:39 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Kernel#puts and Kernel#print with NaN and Infinity values

Hello,

while I was filing a bug report regarding a different behaviour of
Math#hypot compared to the one verified under MRI 1.8.6 (see
http://is.gd/eGHa), I noticed that when a Float instance holds the
values NaN or Infinity then both Kernel#puts and Kernel#print emit
strings localized according to the language settings of the underlying
system. See below, returned strings are in Italian:


IronRuby (SVN r181)
>>> 0.0 / 0
=> NaN
>>> printf("%s", 0.0 / 0)
NaN=> nil
>>> puts 0.0 / 0
Non un numero reale
=> nil
>>> 1.0 / 0
=> Infinity
>>> printf("%s", 1.0 / 0)
Infinity=> nil
>>> puts 1.0 / 0
+Infinito
=> nil


MRI 1.8.6
irb(main):001:0> 0.0 / 0
=> NaN
irb(main):002:0> printf("%s", 0.0 / 0)
NaN=> nil
irb(main):003:0> puts 0.0 / 0
NaN
=> nil
irb(main):004:0> 1.0 / 0
=> Infinity
irb(main):005:0> printf("%s", 1.0 / 0)
Infinity=> nil
irb(main):006:0> puts 1.0 / 0
Infinity


Should this be considered a bug?

--
Daniele Alessandri
http://www.clorophilla.net/blog/
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core



More information about the Ironruby-core mailing list