File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed
lib/node_modules/@stdlib/math/base/special/truncbf Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,13 @@ var native = tryRequire( './native.js' );
5454// MAIN //
5555
5656if ( native instanceof Error ) {
57- native = null ;
57+ native = null ;
5858}
5959if ( native ) {
60- setReadOnly ( main , 'native' , native ) ;
60+ setReadOnly ( main , 'native' , native ) ;
6161}
6262
6363
6464// EXPORTS //
6565
66- module . exports = main ;
66+ module . exports = main ;
Original file line number Diff line number Diff line change 3535* // returns 3.14f
3636*/
3737float stdlib_base_truncbf ( const float x , const int32_t n , const int32_t b ) {
38- float s ;
38+ float s ;
3939
40- // Use standard macros from <math.h> because we removed the stdlib headers
41- if ( isnan ( x ) || isinf ( x ) || x == 0.0f ) {
42- return x ;
43- }
44- if ( b == 0 ) {
45- return 0.0f / 0.0f ; // Return NaN
46- }
40+ // Use standard macros from <math.h> because we removed the stdlib headers
41+ if ( isnan ( x ) || isinf ( x ) || x == 0.0f ) {
42+ return x ;
43+ }
44+ if ( b == 0 ) {
45+ return 0.0f / 0.0f ; // Return NaN
46+ }
4747
48- // Compute scale factor: s = b^n using single precision (powf)
49- s = stdlib_base_powf ( (float )b , (float )n );
48+ // Compute scale factor: s = b^n using single precision (powf)
49+ s = stdlib_base_powf ( (float )b , (float )n );
5050
51- // Multiply by scale, truncate (using truncf), then divide by scale
52- return stdlib_base_truncf ( x * s ) / s ;
51+ // Multiply by scale, truncate (using truncf), then divide by scale
52+ return stdlib_base_truncf ( x * s ) / s ;
5353}
5454
You can’t perform that action at this time.
0 commit comments