Skip to content

Commit c6a602f

Browse files
fix: lint errors
1 parent 3f6ea1f commit c6a602f

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/node_modules/@stdlib/math/base/special/ceilnf/lib/native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var addon = require( './../src/addon.node' );
3636
* @example
3737
* // Round a value to 2 decimal places:
3838
* var v = ceilnf( 3.141592653589793, -2 );
39-
* // returns 3.15
39+
* // returns 3.1500000953674316
4040
*
4141
* @example
4242
* // If n = 0, `ceilnf` behaves like `ceilf`:
@@ -46,7 +46,7 @@ var addon = require( './../src/addon.node' );
4646
* @example
4747
* // Round a value to the nearest thousand:
4848
* var v = ceilnf( 12368.0, 3 );
49-
* // returns 13000.0
49+
* // returns 12999.9990234375
5050
*/
5151
function ceilnf( x, n ) {
5252
return addon( x, n );

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232

3333
// VARIABLES //
3434

35-
static const float MAX_INT = STDLIB_CONSTANT_FLOAT32_MAX_SAFE_INTEGER + 1.0;
36-
static const float HUGE_VALUE = 1.0e+308;
35+
static const float MAX_INT = STDLIB_CONSTANT_FLOAT32_MAX_SAFE_INTEGER + 1.0f;
36+
static const float HUGE_VALUE = 1.0e+308f;
3737

3838

3939
// MAIN //
@@ -71,7 +71,7 @@ float stdlib_base_ceilnf( const float x, const int32_t n ) {
7171
stdlib_base_is_infinitef( x ) ||
7272

7373
// Handle +-0...
74-
x == 0.0 ||
74+
x == 0.0f ||
7575

7676
// If `n` exceeds the maximum number of feasible decimal places (such as with subnormal numbers), nothing to round...
7777
n < STDLIB_CONSTANT_FLOAT32_MIN_BASE10_EXPONENT_SUBNORMAL ||
@@ -83,21 +83,21 @@ float stdlib_base_ceilnf( const float x, const int32_t n ) {
8383
}
8484
// The maximum absolute double is ~1.8e308. Accordingly, any possible positive finite `x` rounded to the nearest >=10^309 is infinity and any negative finite `x` is zero.
8585
if ( n > STDLIB_CONSTANT_FLOAT32_MAX_BASE10_EXPONENT ) {
86-
if ( x <= 0.0 ) {
87-
return -0.0; // preserve the sign (same behavior as ceil)
86+
if ( x <= 0.0f ) {
87+
return -0.0f; // preserve the sign (same behavior as ceil)
8888
}
8989
return STDLIB_CONSTANT_FLOAT32_PINF;
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_FLOAT32_MIN_BASE10_EXPONENT ) {
93-
s = pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT32_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
93+
s = pow( 10.0f, -( n + STDLIB_CONSTANT_FLOAT32_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
9494
y = ( x * HUGE_VALUE ) * s; // order of operation matters!
9595
if ( stdlib_base_is_infinitef( y ) ) {
9696
return x;
9797
}
9898
return ( stdlib_base_ceilf( y ) / HUGE_VALUE ) / s;
9999
}
100-
s = pow( 10.0, -n ); // TODO: replace use of `pow` once have stdlib equivalent
100+
s = pow( 10.0f, -n ); // TODO: replace use of `pow` once have stdlib equivalent
101101
y = x * s;
102102
if ( stdlib_base_is_infinitef( y ) ) {
103103
return x;

0 commit comments

Comments
 (0)