Feature #9522

Float( "NaN" ), Float( "Infinity" )

Added by Anonymous over 1 year ago.

[ruby-core:60782]
Status:Open
Priority:Normal
Assignee:-

Description

I have noticed that 0.0 / 0.0 returns NaN, but Float( "#{0.0 / 0.0}" ),
or simply Float( "NaN" ) does not return Float::NAN, failing instead.
To me, even inclusion of NaN among floats is somewhat questionable, but
since it's there, Float( "NaN" ) needs to be discussed. Same would go
for Float( "Infinity" ).

The issue here might be that not all the users are aware that NaN and
Infinity have special meaning in the context of floats, and they might
use these strings inadvertantly without actually meaning a Float.

Also available in: Atom PDF