WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 1cfe041

Browse files
committed
fix: restore correct includes in main.c - use pow/trunc instead of powf/truncf
1 parent 5365aa1 commit 1cfe041

File tree

2 files changed

+15
-15
lines changed
  • lib/node_modules/@stdlib/math/base/special/truncbf

2 files changed

+15
-15
lines changed

lib/node_modules/@stdlib/math/base/special/truncbf/lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ var native = tryRequire( './native.js' );
5454
// MAIN //
5555

5656
if ( native instanceof Error ) {
57-
native = null;
57+
native = null;
5858
}
5959
if ( 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;

lib/node_modules/@stdlib/math/base/special/truncbf/src/main.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@
3535
* // returns 3.14f
3636
*/
3737
float 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

0 commit comments

Comments
 (0)