[APFloat] Make all arithmetic operations with NaN produce positive NaNs.
authorMichael Gottesman <mgottesman@apple.com>
Sat, 27 Jul 2013 21:49:25 +0000 (21:49 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Sat, 27 Jul 2013 21:49:25 +0000 (21:49 +0000)
commitca4d2e60ea36bd4f532ab5d52f5b4394a33be819
tree73ef5bba6021cf78f8b7149eb5219108d4b214b6
parent060d34b1cf9a1185b24db95925f23d9fbadce078
[APFloat] Make all arithmetic operations with NaN produce positive NaNs.

IEEE-754R 1.4 Exclusions states that IEEE-754R does not specify the
interpretation of the sign of NaNs. In order to remove an irrelevant
variable that most floating point implementations do not use,
standardize add, sub, mul, div, mod so that operating anything with
NaN always yields a positive NaN.

In a later commit I am going to update the APIs for creating NaNs so
that one can not even create a negative NaN.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187314 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/APFloat.cpp
unittests/ADT/APFloatTest.cpp