Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@stdlib/math/base/napi/binary",
"@stdlib/math/base/special/abs",
"@stdlib/math/base/special/ceil",
"@stdlib/math/base/special/pow",
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/assert/is-infinite",
"@stdlib/constants/float64/max-base10-exponent",
Expand All @@ -65,6 +66,7 @@
"dependencies": [
"@stdlib/math/base/special/abs",
"@stdlib/math/base/special/ceil",
"@stdlib/math/base/special/pow",
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/assert/is-infinite",
"@stdlib/constants/float64/max-base10-exponent",
Expand All @@ -89,6 +91,7 @@
"dependencies": [
"@stdlib/math/base/special/abs",
"@stdlib/math/base/special/ceil",
"@stdlib/math/base/special/pow",
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/assert/is-infinite",
"@stdlib/constants/float64/max-base10-exponent",
Expand Down
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/math/base/special/ceiln/src/ceiln.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "stdlib/math/base/special/ceiln.h"
#include "stdlib/math/base/special/ceil.h"
#include "stdlib/math/base/special/abs.h"
#include "stdlib/math/base/special/pow.h"
#include "stdlib/math/base/assert/is_nan.h"
#include "stdlib/math/base/assert/is_infinite.h"
#include "stdlib/constants/float64/max_base10_exponent.h"
Expand All @@ -27,7 +28,6 @@
#include "stdlib/constants/float64/max_safe_integer.h"
#include "stdlib/constants/float64/pinf.h"
#include <stdint.h>
#include <math.h>


// VARIABLES //
Expand Down Expand Up @@ -90,14 +90,14 @@ double stdlib_base_ceiln( const double x, const int32_t n ) {
}
// 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...
if ( n < STDLIB_CONSTANT_FLOAT64_MIN_BASE10_EXPONENT ) {
s = pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT64_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
s = stdlib_base_pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT64_MAX_BASE10_EXPONENT ) );
y = ( x * HUGE_VALUE ) * s; // order of operation matters!
if ( stdlib_base_is_infinite( y ) ) {
return x;
}
return ( stdlib_base_ceil( y ) / HUGE_VALUE ) / s;
}
s = pow( 10.0, -n ); // TODO: replace use of `pow` once have stdlib equivalent
s = stdlib_base_pow( 10.0, -n );
y = x * s;
if ( stdlib_base_is_infinite( y ) ) {
return x;
Expand Down