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 - The Fusion of Science and Community**

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?

Loading...

Similar Threads - Floating point +inf | Date |
---|---|

Testing floating point numbers for equality | Jan 12, 2018 |

Floating point numbers | Mar 9, 2016 |

What type of floating point representation is this? | Jul 1, 2015 |

Floating point numbers. | Sep 20, 2013 |

Fortran 90 (floating point error) | Apr 8, 2013 |

**Physics Forums - The Fusion of Science and Community**