Skip to content

Commit 8de8d90

Browse files
authored
refactor: perform explicit cast
PR-URL: #2642 Reviewed-by: Athan Reines <[email protected]>
1 parent 6a0cbd9 commit 8de8d90

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

lib/node_modules/@stdlib/math/base/special/floorsd/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,22 @@ for ( i = 0; i < 100; i++ ) {
8383

8484
<!-- /.examples -->
8585

86+
<!-- C interface documentation. -->
87+
88+
* * *
89+
90+
<section class="c">
91+
92+
## C APIs
93+
94+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
95+
96+
<section class="intro">
97+
98+
</section>
99+
100+
<!-- /.intro -->
101+
86102
<!-- C usage documentation. -->
87103

88104
<section class="usage">

lib/node_modules/@stdlib/math/base/special/floorsd/docs/types/test.ts

-14
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@ import floorsd = require( './index' );
2828

2929
// The compiler throws an error if the function is provided values other than numbers...
3030
{
31-
floorsd( true, 3 ); // $ExpectError
32-
floorsd( false, 2 ); // $ExpectError
33-
floorsd( '5', 1 ); // $ExpectError
34-
floorsd( [], 1 ); // $ExpectError
35-
floorsd( {}, 2 ); // $ExpectError
36-
floorsd( ( x: number ): number => x, 2 ); // $ExpectError
37-
38-
floorsd( 9, true ); // $ExpectError
39-
floorsd( 9, false ); // $ExpectError
40-
floorsd( 5, '5' ); // $ExpectError
41-
floorsd( 8, [] ); // $ExpectError
42-
floorsd( 9, {} ); // $ExpectError
43-
floorsd( 8, ( x: number ): number => x ); // $ExpectError
44-
4531
floorsd( true, 3, 2 ); // $ExpectError
4632
floorsd( false, 2, 2 ); // $ExpectError
4733
floorsd( '5', 1, 2 ); // $ExpectError

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ double stdlib_base_floorsd( const double x, const int32_t n, const int32_t b ) {
5757
} else {
5858
exp = stdlib_base_ln( stdlib_base_abs( x ) ) / stdlib_base_ln( (double)b );
5959
}
60-
exp = stdlib_base_floor( exp - n + 1.0 );
60+
exp = stdlib_base_floor( exp - (double)n + 1.0 );
6161
s = stdlib_base_pow( (double)b, stdlib_base_abs( exp ) );
6262

6363
// Check for overflow:

0 commit comments

Comments
 (0)