Project

General

Profile

Actions

Bug #5884

closed

Float::NAN and 0.0/0.0 is represented differently when packed with 'g'

Added by hasari (Hiro Asari) almost 13 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0dev (2011-12-31 trunk 34165) [x86_64-darwin11.2.0]
Backport:
[ruby-core:42063]

Description

$ ruby2.0 -e 'p [Float::NAN].pack("g")'
"\x7F\xC0\x00\x00"

$ ruby2.0 -e 'p [0.0/0.0].pack("g")'
"\xFF\xC0\x00\x00"

It would be nice to have Float::NAN and 0.0/0.0 behave identically in this regard.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0