Two pieces of maths software that I have handle these floating point "special values" differently. One returns(adsbygoogle = window.adsbygoogle || []).push({}); +infand the other returnsnan. (For the calculation of+inf - nan).

I can see some logic to both of those answers. I guess in first case it is following a rule that+inf - (anything other than +inf) = +inf(and+inf - +inf = nan). While in the second case I guess it's following the rule thatnan (+ - * /) anything = nan.

Does anyone know of any "standard" for dealing with these special FP values that would make one of the above interpretations more correct than the other.

Thanks. :)

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Floating point : (+inf - nan) = ? What the most correct way of handling this?

**Physics Forums | Science Articles, Homework Help, Discussion**