You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The maximum absolute double is ~1.8e308. Accordingly, any possible positive finite `x` rounded to the nearest >=10^309 is infinity and any negative finite `x` is zero.
85
85
if ( n>STDLIB_CONSTANT_FLOAT32_MAX_BASE10_EXPONENT ) {
86
-
if ( x <= 0.0 ) {
87
-
return-0.0; // preserve the sign (same behavior as ceil)
86
+
if ( x <= 0.0f ) {
87
+
return-0.0f; // preserve the sign (same behavior as ceil)
88
88
}
89
89
returnSTDLIB_CONSTANT_FLOAT32_PINF;
90
90
}
91
91
// If we overflow, return `x`, as the number of digits to the right of the decimal is too small (i.e., `x` is too large / lacks sufficient fractional precision) for there to be any effect when rounding...
92
92
if ( n<STDLIB_CONSTANT_FLOAT32_MIN_BASE10_EXPONENT ) {
93
-
s=pow( 10.0, -( n+STDLIB_CONSTANT_FLOAT32_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
93
+
s=pow( 10.0f, -( n+STDLIB_CONSTANT_FLOAT32_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
94
94
y= ( x*HUGE_VALUE ) *s; // order of operation matters!
95
95
if ( stdlib_base_is_infinitef( y ) ) {
96
96
returnx;
97
97
}
98
98
return ( stdlib_base_ceilf( y ) / HUGE_VALUE ) / s;
99
99
}
100
-
s=pow( 10.0, -n ); // TODO: replace use of `pow` once have stdlib equivalent
100
+
s=pow( 10.0f, -n ); // TODO: replace use of `pow` once have stdlib equivalent
0 commit comments