@@ -915,6 +915,8 @@ ieee_floatt &ieee_floatt::operator-=(const ieee_floatt &other)
915
915
916
916
bool ieee_floatt::operator <(const ieee_floatt &other) const
917
917
{
918
+ PRECONDITION (other.spec == spec);
919
+
918
920
if (NaN_flag || other.NaN_flag )
919
921
return false ;
920
922
@@ -961,6 +963,8 @@ bool ieee_floatt::operator<(const ieee_floatt &other) const
961
963
962
964
bool ieee_floatt::operator <=(const ieee_floatt &other) const
963
965
{
966
+ PRECONDITION (other.spec == spec);
967
+
964
968
if (NaN_flag || other.NaN_flag )
965
969
return false ;
966
970
@@ -994,6 +998,8 @@ bool ieee_floatt::operator>=(const ieee_floatt &other) const
994
998
995
999
bool ieee_floatt::operator ==(const ieee_floatt &other) const
996
1000
{
1001
+ PRECONDITION (other.spec == spec);
1002
+
997
1003
// packed equality!
998
1004
if (NaN_flag && other.NaN_flag )
999
1005
return true ;
@@ -1016,6 +1022,8 @@ bool ieee_floatt::operator==(const ieee_floatt &other) const
1016
1022
1017
1023
bool ieee_floatt::ieee_equal (const ieee_floatt &other) const
1018
1024
{
1025
+ PRECONDITION (other.spec == spec);
1026
+
1019
1027
if (NaN_flag || other.NaN_flag )
1020
1028
return false ;
1021
1029
if (is_zero () && other.is_zero ())
@@ -1038,6 +1046,8 @@ bool ieee_floatt::operator!=(const ieee_floatt &other) const
1038
1046
1039
1047
bool ieee_floatt::ieee_not_equal (const ieee_floatt &other) const
1040
1048
{
1049
+ PRECONDITION (other.spec == spec);
1050
+
1041
1051
if (NaN_flag || other.NaN_flag )
1042
1052
return true ; // !!!
1043
1053
if (is_zero () && other.is_zero ())
0 commit comments