@@ -1257,36 +1257,40 @@ frange::set_undefined ()
verify_range ();
}
-// Set the NAN bit and adjust the range.
+// Set the NAN bits to NAN and adjust the range.
inline void
-frange::update_nan ()
+frange::update_nan (const nan_state &nan)
{
gcc_checking_assert (!undefined_p ());
if (HONOR_NANS (m_type))
{
- m_pos_nan = true;
- m_neg_nan = true;
+ m_pos_nan = nan.pos_p ();
+ m_neg_nan = nan.neg_p ();
normalize_kind ();
if (flag_checking)
verify_range ();
}
}
+// Set the NAN bit to +-NAN.
+
+inline void
+frange::update_nan ()
+{
+ gcc_checking_assert (!undefined_p ());
+ nan_state nan (true);
+ update_nan (nan);
+}
+
// Like above, but set the sign of the NAN.
inline void
frange::update_nan (bool sign)
{
gcc_checking_assert (!undefined_p ());
- if (HONOR_NANS (m_type))
- {
- m_pos_nan = !sign;
- m_neg_nan = sign;
- normalize_kind ();
- if (flag_checking)
- verify_range ();
- }
+ nan_state nan (/*pos=*/!sign, /*neg=*/sign);
+ update_nan (nan);
}
inline bool