@stdlib/math-base-special-ceiln 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/include/stdlib/math/base/special/ceiln.h +0 -3
- package/package.json +16 -37
- package/src/ceiln.c +3 -3
- package/include.gypi +0 -53
package/README.md
CHANGED
|
@@ -272,8 +272,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
272
272
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-special-ceiln.svg
|
|
273
273
|
[npm-url]: https://npmjs.org/package/@stdlib/math-base-special-ceiln
|
|
274
274
|
|
|
275
|
-
[test-image]: https://github.com/stdlib-js/math-base-special-ceiln/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
276
|
-
[test-url]: https://github.com/stdlib-js/math-base-special-ceiln/actions/workflows/test.yml?query=branch:v0.2.
|
|
275
|
+
[test-image]: https://github.com/stdlib-js/math-base-special-ceiln/actions/workflows/test.yml/badge.svg?branch=v0.2.2
|
|
276
|
+
[test-url]: https://github.com/stdlib-js/math-base-special-ceiln/actions/workflows/test.yml?query=branch:v0.2.2
|
|
277
277
|
|
|
278
278
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-ceiln/main.svg
|
|
279
279
|
[coverage-url]: https://codecov.io/github/stdlib-js/math-base-special-ceiln?branch=main
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/math-base-special-ceiln",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Round a numeric value to the nearest multiple of 10^n toward positive infinity.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -16,21 +16,14 @@
|
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"gypfile": false,
|
|
18
18
|
"directories": {
|
|
19
|
-
"benchmark": "./benchmark",
|
|
20
19
|
"doc": "./docs",
|
|
21
|
-
"example": "./examples",
|
|
22
20
|
"include": "./include",
|
|
23
21
|
"lib": "./lib",
|
|
24
22
|
"src": "./src",
|
|
25
|
-
"
|
|
23
|
+
"dist": "./dist"
|
|
26
24
|
},
|
|
27
25
|
"types": "./docs/types",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"test": "make test",
|
|
30
|
-
"test-cov": "make test-cov",
|
|
31
|
-
"examples": "make examples",
|
|
32
|
-
"benchmark": "make benchmark"
|
|
33
|
-
},
|
|
26
|
+
"scripts": {},
|
|
34
27
|
"homepage": "https://stdlib.io",
|
|
35
28
|
"repository": {
|
|
36
29
|
"type": "git",
|
|
@@ -40,34 +33,20 @@
|
|
|
40
33
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
41
34
|
},
|
|
42
35
|
"dependencies": {
|
|
43
|
-
"@stdlib/constants-float64-max-base10-exponent": "^0.2.
|
|
44
|
-
"@stdlib/constants-float64-max-safe-integer": "^0.2.
|
|
45
|
-
"@stdlib/constants-float64-min-base10-exponent": "^0.2.
|
|
46
|
-
"@stdlib/constants-float64-min-base10-exponent-subnormal": "^0.2.
|
|
47
|
-
"@stdlib/constants-float64-pinf": "^0.2.
|
|
48
|
-
"@stdlib/math-base-assert-is-infinite": "^0.2.
|
|
49
|
-
"@stdlib/math-base-assert-is-nan": "^0.2.
|
|
50
|
-
"@stdlib/math-base-napi-binary": "^0.
|
|
51
|
-
"@stdlib/math-base-special-abs": "^0.2.
|
|
52
|
-
"@stdlib/math-base-special-ceil": "^0.2.
|
|
53
|
-
"@stdlib/math-base-special-pow": "^0.
|
|
54
|
-
"@stdlib/utils-library-manifest": "^0.2.
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@stdlib/constants-float64-eps": "^0.1.1",
|
|
58
|
-
"@stdlib/constants-float64-ninf": "^0.1.1",
|
|
59
|
-
"@stdlib/constants-float64-pi": "^0.1.1",
|
|
60
|
-
"@stdlib/math-base-assert-is-negative-zero": "^0.1.1",
|
|
61
|
-
"@stdlib/math-base-assert-is-positive-zero": "^0.1.1",
|
|
62
|
-
"@stdlib/math-base-special-round": "^0.1.1",
|
|
63
|
-
"@stdlib/random-base-randu": "^0.1.0",
|
|
64
|
-
"@stdlib/utils-try-require": "^0.2.0",
|
|
65
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
66
|
-
"istanbul": "^0.4.1",
|
|
67
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",
|
|
68
|
-
"@stdlib/bench-harness": "^0.2.0",
|
|
69
|
-
"@stdlib/bench": "^0.3.1"
|
|
36
|
+
"@stdlib/constants-float64-max-base10-exponent": "^0.2.2",
|
|
37
|
+
"@stdlib/constants-float64-max-safe-integer": "^0.2.2",
|
|
38
|
+
"@stdlib/constants-float64-min-base10-exponent": "^0.2.2",
|
|
39
|
+
"@stdlib/constants-float64-min-base10-exponent-subnormal": "^0.2.1",
|
|
40
|
+
"@stdlib/constants-float64-pinf": "^0.2.2",
|
|
41
|
+
"@stdlib/math-base-assert-is-infinite": "^0.2.2",
|
|
42
|
+
"@stdlib/math-base-assert-is-nan": "^0.2.2",
|
|
43
|
+
"@stdlib/math-base-napi-binary": "^0.3.0",
|
|
44
|
+
"@stdlib/math-base-special-abs": "^0.2.2",
|
|
45
|
+
"@stdlib/math-base-special-ceil": "^0.2.2",
|
|
46
|
+
"@stdlib/math-base-special-pow": "^0.3.0",
|
|
47
|
+
"@stdlib/utils-library-manifest": "^0.2.2"
|
|
70
48
|
},
|
|
49
|
+
"devDependencies": {},
|
|
71
50
|
"engines": {
|
|
72
51
|
"node": ">=0.10.0",
|
|
73
52
|
"npm": ">2.7.0"
|
package/src/ceiln.c
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
// VARIABLES //
|
|
34
34
|
|
|
35
35
|
static const double MAX_INT = STDLIB_CONSTANT_FLOAT64_MAX_SAFE_INTEGER + 1.0;
|
|
36
|
-
static const double
|
|
36
|
+
static const double HUGE_VALUE = 1.0e+308;
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
// MAIN //
|
|
@@ -91,11 +91,11 @@ double stdlib_base_ceiln( const double x, const int32_t n ) {
|
|
|
91
91
|
// If we overflow, return `x`, as the number of digits to the right of the decimal is too small (i.e., `x` is too large / lacks sufficient fractional precision) for there to be any effect when rounding...
|
|
92
92
|
if ( n < STDLIB_CONSTANT_FLOAT64_MIN_BASE10_EXPONENT ) {
|
|
93
93
|
s = pow( 10.0, -( n + STDLIB_CONSTANT_FLOAT64_MAX_BASE10_EXPONENT ) ); // TODO: replace use of `pow` once have stdlib equivalent
|
|
94
|
-
y = ( x *
|
|
94
|
+
y = ( x * HUGE_VALUE ) * s; // order of operation matters!
|
|
95
95
|
if ( stdlib_base_is_infinite( y ) ) {
|
|
96
96
|
return x;
|
|
97
97
|
}
|
|
98
|
-
return ( stdlib_base_ceil( y ) /
|
|
98
|
+
return ( stdlib_base_ceil( y ) / HUGE_VALUE ) / s;
|
|
99
99
|
}
|
|
100
100
|
s = pow( 10.0, -n ); // TODO: replace use of `pow` once have stdlib equivalent
|
|
101
101
|
y = x * s;
|
package/include.gypi
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# @license Apache-2.0
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) 2023 The Stdlib Authors.
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
|
|
17
|
-
# A GYP include file for building a Node.js native add-on.
|
|
18
|
-
#
|
|
19
|
-
# Main documentation:
|
|
20
|
-
#
|
|
21
|
-
# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md
|
|
22
|
-
# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md
|
|
23
|
-
{
|
|
24
|
-
# Define variables to be used throughout the configuration for all targets:
|
|
25
|
-
'variables': {
|
|
26
|
-
# Source directory:
|
|
27
|
-
'src_dir': './src',
|
|
28
|
-
|
|
29
|
-
# Include directories:
|
|
30
|
-
'include_dirs': [
|
|
31
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).include; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
32
|
-
],
|
|
33
|
-
|
|
34
|
-
# Add-on destination directory:
|
|
35
|
-
'addon_output_dir': './src',
|
|
36
|
-
|
|
37
|
-
# Source files:
|
|
38
|
-
'src_files': [
|
|
39
|
-
'<(src_dir)/addon.c',
|
|
40
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).src; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
41
|
-
],
|
|
42
|
-
|
|
43
|
-
# Library dependencies:
|
|
44
|
-
'libraries': [
|
|
45
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).libraries; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
# Library directories:
|
|
49
|
-
'library_dirs': [
|
|
50
|
-
'<!@(node -e "var arr = require(\'@stdlib/utils-library-manifest\')(\'./manifest.json\',{},{\'basedir\':process.cwd(),\'paths\':\'posix\'}).libpath; for ( var i = 0; i < arr.length; i++ ) { console.log( arr[ i ] ); }")',
|
|
51
|
-
],
|
|
52
|
-
}, # end variables
|
|
53
|
-
}
|