Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jul 20, 2024
1 parent 4729d58 commit 4c44633
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<section class="release" id="unreleased">

## Unreleased (2024-07-19)
## Unreleased (2024-07-20)

<section class="packages">

Expand Down Expand Up @@ -5463,6 +5463,7 @@ A total of 29 people contributed to this release. Thank you to the following con

<details>

- [`b063947`](https://github.com/stdlib-js/stdlib/commit/b0639472175808254213fd35d2902e52b998b4cc) - **refactor:** reduce code complexity [(#2632)](https://github.com/stdlib-js/stdlib/pull/2632) _(by Gunj Joshi, Athan Reines)_
- [`bd258a3`](https://github.com/stdlib-js/stdlib/commit/bd258a3c2803d841658c7465505966149845a6fb) - **feat:** update namespace TypeScript declarations [(#2628)](https://github.com/stdlib-js/stdlib/pull/2628) _(by stdlib-bot, Athan Reines)_
- [`607135f`](https://github.com/stdlib-js/stdlib/commit/607135f297a48a24d8d312a61ddfe98a332b1ca5) - **feat:** add C implementation for `math/base/special/ceilb` [(##2627)](#2627) _(by Gunj Joshi)_
- [`d4db8a9`](https://github.com/stdlib-js/stdlib/commit/d4db8a93b0c93cb3392b59ee031ce188399b90a5) - **feat:** add C implementation for `math/base/special/ceil10` [(##2626)](#2626) _(by Gunj Joshi)_
Expand Down
6 changes: 1 addition & 5 deletions base/special/floorsd/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ function floorsd( x, n, b ) {
isnan( x ) ||
isnan( n ) ||
n < 1 ||
isInfinite( n )
) {
return NaN;
}
if (
isInfinite( n ) ||
isnan( b ) ||
b <= 0 ||
isInfinite( b )
Expand Down
10 changes: 4 additions & 6 deletions base/special/floorsd/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,25 @@
* // returns 0.03125
*/
double stdlib_base_floorsd( const double x, const int32_t n, const int32_t b ) {
int32_t base;
double exp;
double s;
double y;

if ( stdlib_base_is_nan( x ) || n < 1 || b <= 0 ) {
return 0.0 / 0.0; // NaN
}
base = b;
if ( stdlib_base_is_infinite( x ) || x == 0.0 ) {
return x;
}
if ( base == 10 ) {
if ( b == 10 ) {
exp = stdlib_base_log10( stdlib_base_abs( x ) );
} else if ( base == 2 ) {
} else if ( b == 2 ) {
exp = stdlib_base_float64_exponent( stdlib_base_abs( x ) );
} else {
exp = stdlib_base_ln( stdlib_base_abs( x ) ) / stdlib_base_ln( base );
exp = stdlib_base_ln( stdlib_base_abs( x ) ) / stdlib_base_ln( (double)b );
}
exp = stdlib_base_floor( exp - n + 1.0 );
s = stdlib_base_pow( base, stdlib_base_abs( exp ) );
s = stdlib_base_pow( (double)b, stdlib_base_abs( exp ) );

// Check for overflow:
if ( stdlib_base_is_infinite( s ) ) {
Expand Down

0 comments on commit 4c44633

Please sign in to comment.