Skip to content

Commit 763596a

Browse files
committed
fix: correct float32 doctest values and lint errors in roundnf
1 parent 54a0638 commit 763596a

6 files changed

Lines changed: 28 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Rounds a single-precision floating-point number to the nearest multiple of `10^n
3737
```javascript
3838
// Round a value to 2 decimal places:
3939
var v = roundnf( 3.141592, -2 );
40-
// returns 3.14
40+
// returns 3.140000104904175
4141

4242
// If n = 0, `roundnf` behaves like `roundf`:
4343
v = roundnf( 3.141592, 0 );
@@ -64,7 +64,7 @@ v = roundnf( 1234.56, 2 );
6464

6565
// Should round to 0.3...
6666
var v = roundnf( x, -16 );
67-
// returns ~0.3000000000000001
67+
// returns 0.30000001192092896
6868
```
6969

7070
- Ties are rounded toward positive infinity.

lib/node_modules/@stdlib/math/base/special/roundnf/benchmark/c/native/benchmark.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ int main( void ) {
6666
for ( i = 0; i < 1000; i++ ) {
6767
stdlib_base_roundnf( (float)i, -2 );
6868
}
69-
69+
7070
// Benchmark:
7171
printf( "Benchmark: roundnf\n" );
7272
elapsed = benchmark();
7373
rate = (double)ITERATIONS / elapsed;
7474
printf( " iterations: %d\n", ITERATIONS );
7575
printf( " elapsed: %f sec\n", elapsed );
7676
printf( " rate: %f ops/sec\n", rate );
77-
77+
7878
return 0;
7979
}

lib/node_modules/@stdlib/math/base/special/roundnf/docs/repl.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
--------
2020
// Round to 2 decimal places:
2121
> var y = {{alias}}( 3.141592, -2 )
22-
3.14
22+
3.140000104904175
2323

2424
// Round to nearest integer:
2525
> y = {{alias}}( 3.7, 0 )

lib/node_modules/@stdlib/math/base/special/roundnf/docs/types/index.d.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
121
/**
222
* Rounds a single-precision floating-point number to the nearest multiple of `10^n`.
323
*
@@ -12,7 +32,7 @@
1232
* @example
1333
* // Round a value to 2 decimal places:
1434
* var v = roundnf( 3.141592, -2 );
15-
* // returns 3.14
35+
* // returns 3.140000104904175
1636
*
1737
* @example
1838
* // If n = 0, `roundnf` behaves like `roundf`:

lib/node_modules/@stdlib/math/base/special/roundnf/examples/c/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ all: $(c_targets)
9999
#
100100
# @private
101101
#/
102-
$(c_targets): %.c
102+
$(c_targets): %: %.c
103103
$(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) $(LIBRARIES)
104104

105105
#/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* // Round a value to 2 decimal places:
3030
* var v = roundnf( 3.141592, -2 );
31-
* // returns 3.14
31+
* // returns 3.140000104904175
3232
*
3333
* @example
3434
* var roundnf = require( '@stdlib/math/base/special/roundnf' );

0 commit comments

Comments
 (0)