Daniele Alessandri
2009-Jan-06 15:38 UTC
[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 / 0Non 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/
Tomas Matousek
2009-Jan-06 16:07 UTC
[Ironruby-core] Kernel#puts and Kernel#print with NaN and Infinity values
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 / 0Non 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
Daniele Alessandri
2009-Jan-06 16:47 UTC
[Ironruby-core] Kernel#puts and Kernel#print with NaN and Infinity values
On Tue, Jan 6, 2009 at 17:07, Tomas Matousek <Tomas.Matousek at microsoft.com> wrote:> Yes, could you please file it?Ok, just filed it. -- Daniele Alessandri http://www.clorophilla.net/blog/