aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APFloat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/APFloat.cpp')
-rw-r--r--lib/Support/APFloat.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 393ecf4..5a402bb 100644
--- a/lib/Support/APFloat.cpp
+++ b/lib/Support/APFloat.cpp
@@ -1248,10 +1248,10 @@ APFloat::roundAwayFromZero(roundingMode rounding_mode,
return false;
case rmTowardPositive:
- return sign == false;
+ return !sign;
case rmTowardNegative:
- return sign == true;
+ return sign;
}
llvm_unreachable("Invalid rounding mode found");
}
@@ -1430,7 +1430,7 @@ APFloat::addOrSubtractSignificand(const APFloat &rhs, bool subtract)
/* Determine if the operation on the absolute values is effectively
an addition or subtraction. */
- subtract ^= (sign ^ rhs.sign) ? true : false;
+ subtract ^= static_cast<bool>(sign ^ rhs.sign);
/* Are we bigger exponent-wise than the RHS? */
bits = exponent - rhs.exponent;