Skip to content

Commit 8b4a8b8

Browse files
authored
Update example.c
Signed-off-by: Gunj Joshi <[email protected]>
1 parent 300cd0d commit 8b4a8b8

File tree

1 file changed

+3
-2
lines changed
  • lib/node_modules/@stdlib/math/base/special/ldexp/examples/c

1 file changed

+3
-2
lines changed

lib/node_modules/@stdlib/math/base/special/ldexp/examples/c/example.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ int main( void ) {
4141
for ( i = 0; i < 100; i++ ) {
4242
if ( rand_double() < 0.5 ) {
4343
sign = -1.0;
44-
} else {
44+
} else {
4545
sign = 1.0;
4646
}
47+
4748
// Generate a random number:
4849
frac = rand_double() * 10.0;
4950
exp = (int32_t)( rand_double()*616.0 ) - 308;
50-
x = sign * frac * stdlib_base_pow( 10.0, exp );
51+
x = sign * frac * stdlib_base_pow( 10.0, (double)exp );
5152

5253
// Break the number into a normalized fraction and an integer power of two:
5354
stdlib_base_frexp( x, &frac, &exp );

0 commit comments

Comments
 (0)