[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)
commitb0e688e87ca7aad688f594bafa0c55a47c64ea3b
tree16b2da6ad381d9cf00b8679f2d61ec8ff89e563d
parent30a90eb1a54284535036cbb20b914dd229e5fb07
[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.

llvm-svn: 187314
llvm/lib/Support/APFloat.cpp
llvm/unittests/ADT/APFloatTest.cpp