-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
docsThis change adds or pertains to documentationThis change adds or pertains to documentationmathsMathematical functionsMathematical functions
Description
There are a bunch of different NaN values. reinterpret(Float64, reinterpret(UInt64, NaN) + 1) and NaN are two examples.
NaNs propagate through floating point operations. sin(NaN) must be NaN in the sense of isnan(sin(NaN)), but which NaN should it return? Must it return the canonical NaN? Must it return its input? May it return some other number that isnan for performance reasons? These questions come up for most math functions, min/max/sort, and possibly others.
I propose to explicitly document that mathematical functions (e.g. sin, hypot, min) will produce an NaN result on NaN input but that which NaN is produced is an implementation detail.
oscardssmith, sefffal, ViralBShah, udohjeremiah, dalum and 1 more
Metadata
Metadata
Assignees
Labels
docsThis change adds or pertains to documentationThis change adds or pertains to documentationmathsMathematical functionsMathematical functions