Skip to content

Commit 8f74766

Browse files
feat(math): add math/base/special/round10f
1 parent 7ccdcc8 commit 8f74766

File tree

1 file changed

+6
-6
lines changed
  • lib/node_modules/@stdlib/math/base/special/round10f/src

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#include "stdlib/math/base/special/round10f.h"
2020
#include "stdlib/math/base/assert/is_nan.h"
2121
#include "stdlib/math/base/assert/is_infinite.h"
22-
#include "stdlib/math/base/special/floorf.h"
22+
#include "stdlib/math/base/special/floor.h"
2323
#include "stdlib/math/base/special/pow.h"
24-
#include "stdlib/math/base/special/ceilf.h"
25-
#include "stdlib/math/base/special/logf.h"
24+
#include "stdlib/math/base/special/ceil.h"
25+
#include "stdlib/math/base/special/log10.h"
2626
#include "stdlib/constants/float32/max_base10_exponent.h"
2727
#include "stdlib/constants/float32/min_base10_exponent_subnormal.h"
2828

@@ -64,11 +64,11 @@ float stdlib_base_round10f( const float x ) {
6464
}
6565

6666
// Solve the equation `10^p = x` for `p`:
67-
p = stdlib_base_logf( xc, 10.0 );
67+
p = (float)stdlib_base_log10( xc );
6868

6969
// Find the previous and next integer powers:
70-
p1 = stdlib_base_floorf( p );
71-
p2 = stdlib_base_ceilf( p );
70+
p1 = (float)stdlib_base_floor( p );
71+
p2 = (float)stdlib_base_ceil( p );
7272

7373
// Handle tiny:
7474
if ( p1 == STDLIB_CONSTANT_FLOAT32_MIN_BASE10_EXPONENT_SUBNORMAL ) {

0 commit comments

Comments
 (0)