@@ -24,7 +24,7 @@ inline float __builtin_fabsf(float f) { return __CPROVER_fabsf(f); }
24
24
25
25
/* FUNCTION: __builtin_isgreater */
26
26
27
- int __builtin_isgreater (float f , float g ) { return f > g ; }
27
+ int __builtin_isgreater (double f , double g ) { return f > g ; }
28
28
29
29
/* FUNCTION: __builtin_isgreaterequal */
30
30
@@ -40,7 +40,7 @@ int __builtin_islessequal(float f, float g) { return f <= g; }
40
40
41
41
/* FUNCTION: __builtin_islessgreater */
42
42
43
- int __builtin_islessgreater (float f , float g ) { return (f < g ) || (g > f ); }
43
+ int __builtin_islessgreater (float f , float g ) { return (f < g ) || (f > g ); }
44
44
45
45
/* FUNCTION: __builtin_isunordered */
46
46
@@ -2050,6 +2050,9 @@ double __sort_of_CPROVER_round_to_integral (int rounding_mode, double d);
2050
2050
2051
2051
double __sort_of_CPROVER_remainder (int rounding_mode , double x , double y )
2052
2052
{
2053
+ if (x == 0.0 || __CPROVER_isinfd (y ))
2054
+ return x ;
2055
+
2053
2056
// Extended precision helps... a bit...
2054
2057
long double div = x /y ;
2055
2058
long double n = __sort_of_CPROVER_round_to_integral (rounding_mode ,div );
@@ -2064,6 +2067,9 @@ float __sort_of_CPROVER_round_to_integralf (int rounding_mode, float d);
2064
2067
2065
2068
float __sort_of_CPROVER_remainderf (int rounding_mode , float x , float y )
2066
2069
{
2070
+ if (x == 0.0f || __CPROVER_isinff (y ))
2071
+ return x ;
2072
+
2067
2073
// Extended precision helps... a bit...
2068
2074
long double div = x /y ;
2069
2075
long double n = __sort_of_CPROVER_round_to_integral (rounding_mode ,div );
@@ -2078,6 +2084,9 @@ long double __sort_of_CPROVER_round_to_integrall (int rounding_mode, long double
2078
2084
2079
2085
long double __sort_of_CPROVER_remainderl (int rounding_mode , long double x , long double y )
2080
2086
{
2087
+ if (x == 0.0 || __CPROVER_isinfld (y ))
2088
+ return x ;
2089
+
2081
2090
// Extended precision helps... a bit...
2082
2091
long double div = x /y ;
2083
2092
long double n = __sort_of_CPROVER_round_to_integral (rounding_mode ,div );
0 commit comments