Forum: IronRuby Kernel#puts and Kernel#print with NaN and Infinity values

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniele A. (Guest)
on 2009-01-06 17:40
(Received via mailing list)
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?
Tomas M. (Guest)
on 2009-01-06 18:24
(Received via mailing list)
Yes, could you please file it?

Thanks,
Tomas
Daniele A. (Guest)
on 2009-01-06 18:48
(Received via mailing list)
On Tue, Jan 6, 2009 at 17:07, Tomas M.
<removed_email_address@domain.invalid> wrote:

> Yes, could you please file it?

Ok, just filed it.
This topic is locked and can not be replied to.