File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
lib/node_modules/@stdlib/math/base/special/ldexp Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ double stdlib_base_ldexp( const double frac, const int32_t exp );
183183```c
184184#include "stdlib/math/base/special/ldexp.h"
185185#include "stdlib/math/base/special/frexp.h"
186+ #include "stdlib/math/base/special/pow.h"
186187#include <stdlib.h>
187188#include <stdint.h>
188189#include <stdio.h>
@@ -208,10 +209,11 @@ int main( void ) {
208209 } else {
209210 sign = 1.0;
210211 }
212+
211213 // Generate a random number:
212214 frac = rand_double() * 10.0;
213- exp = (int32_t)( rand_double()* 616.0 ) - 308;
214- x = sign * frac * pow ( 10.0, exp );
215+ exp = (int32_t)( rand_double() * 616.0 ) - 308;
216+ x = sign * frac * stdlib_base_pow ( 10.0, (double) exp );
215217
216218 // Break the number into a normalized fraction and an integer power of two:
217219 stdlib_base_frexp( x, &frac, &exp );
You can’t perform that action at this time.
0 commit comments