Project

General

Profile

Actions

Feature #9522

open

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

Added by Anonymous about 10 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:60782]

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.

No data to display

Actions

Also available in: Atom PDF

Like0