We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 300cd0d commit 8b4a8b8Copy full SHA for 8b4a8b8
lib/node_modules/@stdlib/math/base/special/ldexp/examples/c/example.c
@@ -41,13 +41,14 @@ int main( void ) {
41
for ( i = 0; i < 100; i++ ) {
42
if ( rand_double() < 0.5 ) {
43
sign = -1.0;
44
- } else {
+ } else {
45
sign = 1.0;
46
}
47
+
48
// Generate a random number:
49
frac = rand_double() * 10.0;
50
exp = (int32_t)( rand_double()*616.0 ) - 308;
- x = sign * frac * stdlib_base_pow( 10.0, exp );
51
+ x = sign * frac * stdlib_base_pow( 10.0, (double)exp );
52
53
// Break the number into a normalized fraction and an integer power of two:
54
stdlib_base_frexp( x, &frac, &exp );
0 commit comments