Skip to content

Commit ef90f52

Browse files
chore: replace pow with stdlib_base_pow
PR-URL: #6366 Reviewed-by: Philipp Burckhardt <[email protected]>
1 parent 6001e62 commit ef90f52

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/node_modules/@stdlib/math/base/special/ceiln/manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@stdlib/math/base/napi/binary",
4242
"@stdlib/math/base/special/abs",
4343
"@stdlib/math/base/special/ceil",
44+
"@stdlib/math/base/special/pow",
4445
"@stdlib/math/base/assert/is-nan",
4546
"@stdlib/math/base/assert/is-infinite",
4647
"@stdlib/constants/float64/max-base10-exponent",
@@ -65,6 +66,7 @@
6566
"dependencies": [
6667
"@stdlib/math/base/special/abs",
6768
"@stdlib/math/base/special/ceil",
69+
"@stdlib/math/base/special/pow",
6870
"@stdlib/math/base/assert/is-nan",
6971
"@stdlib/math/base/assert/is-infinite",
7072
"@stdlib/constants/float64/max-base10-exponent",
@@ -89,6 +91,7 @@
8991
"dependencies": [
9092
"@stdlib/math/base/special/abs",
9193
"@stdlib/math/base/special/ceil",
94+
"@stdlib/math/base/special/pow",
9295
"@stdlib/math/base/assert/is-nan",
9396
"@stdlib/math/base/assert/is-infinite",
9497
"@stdlib/constants/float64/max-base10-exponent",

lib/node_modules/@stdlib/math/base/special/ceiln/src/ceiln.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "stdlib/math/base/special/ceiln.h"
2020
#include "stdlib/math/base/special/ceil.h"
2121
#include "stdlib/math/base/special/abs.h"
22+
#include "stdlib/math/base/special/pow.h"
2223
#include "stdlib/math/base/assert/is_nan.h"
2324
#include "stdlib/math/base/assert/is_infinite.h"
2425
#include "stdlib/constants/float64/max_base10_exponent.h"
@@ -27,7 +28,6 @@
2728
#include "stdlib/constants/float64/max_safe_integer.h"
2829
#include "stdlib/constants/float64/pinf.h"
2930
#include <stdint.h>
30-
#include <math.h>
3131

3232

3333
// VARIABLES //
@@ -90,14 +90,14 @@ double stdlib_base_ceiln( const double x, const int32_t n ) {
9090
}
9191
// 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...
9292
if ( n < STDLIB_CONSTANT_FLOAT64_MIN_BASE10_EXPONENT ) {
93-
s = pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT64_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
93+
s = stdlib_base_pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT64_MAX_BASE10_EXPONENT ) );
9494
y = ( x * HUGE_VALUE ) * s; // order of operation matters!
9595
if ( stdlib_base_is_infinite( y ) ) {
9696
return x;
9797
}
9898
return ( stdlib_base_ceil( y ) / HUGE_VALUE ) / s;
9999
}
100-
s = pow( 10.0, -n ); // TODO: replace use of `pow` once have stdlib equivalent
100+
s = stdlib_base_pow( 10.0, -n );
101101
y = x * s;
102102
if ( stdlib_base_is_infinite( y ) ) {
103103
return x;

0 commit comments

Comments
 (0)