@@ -915,6 +915,8 @@ ieee_floatt &ieee_floatt::operator-=(const ieee_floatt &other)
915915
916916bool ieee_floatt::operator <(const ieee_floatt &other) const
917917{
918+ PRECONDITION (other.spec == spec);
919+
918920 if (NaN_flag || other.NaN_flag )
919921 return false ;
920922
@@ -961,6 +963,8 @@ bool ieee_floatt::operator<(const ieee_floatt &other) const
961963
962964bool ieee_floatt::operator <=(const ieee_floatt &other) const
963965{
966+ PRECONDITION (other.spec == spec);
967+
964968 if (NaN_flag || other.NaN_flag )
965969 return false ;
966970
@@ -994,6 +998,8 @@ bool ieee_floatt::operator>=(const ieee_floatt &other) const
994998
995999bool ieee_floatt::operator ==(const ieee_floatt &other) const
9961000{
1001+ PRECONDITION (other.spec == spec);
1002+
9971003 // packed equality!
9981004 if (NaN_flag && other.NaN_flag )
9991005 return true ;
@@ -1016,6 +1022,8 @@ bool ieee_floatt::operator==(const ieee_floatt &other) const
10161022
10171023bool ieee_floatt::ieee_equal (const ieee_floatt &other) const
10181024{
1025+ PRECONDITION (other.spec == spec);
1026+
10191027 if (NaN_flag || other.NaN_flag )
10201028 return false ;
10211029 if (is_zero () && other.is_zero ())
@@ -1038,6 +1046,8 @@ bool ieee_floatt::operator!=(const ieee_floatt &other) const
10381046
10391047bool ieee_floatt::ieee_not_equal (const ieee_floatt &other) const
10401048{
1049+ PRECONDITION (other.spec == spec);
1050+
10411051 if (NaN_flag || other.NaN_flag )
10421052 return true ; // !!!
10431053 if (is_zero () && other.is_zero ())
0 commit comments