@stdlib/math-base-special-abs 0.2.1 → 0.2.3

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/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -29,7 +29,7 @@ limitations under the License.
29
29
  <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
30
  </details>
31
31
 
32
- # Absolute Value
32
+ # abs
33
33
 
34
34
  [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
35
35
 
@@ -42,7 +42,7 @@ The [absolute value][absolute-value] is defined as
42
42
  <!-- <equation class="equation" label="eq:absolute_value" align="center" raw="|x| = \begin{cases} x & \textrm{if}\ x \geq 0 \\ -x & \textrm{if}\ x < 0\end{cases}" alt="Absolute value"> -->
43
43
 
44
44
  <div class="equation" align="center" data-raw-text="|x| = \begin{cases} x &amp; \textrm{if}\ x \geq 0 \\ -x &amp; \textrm{if}\ x &lt; 0\end{cases}" data-equation="eq:absolute_value">
45
- <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/C:\Users\pb\Documents\GitHub\stdlib\lib\node_modules\@stdlib\math\base\special\abs\docs\img\equation_absolute_value.svg" alt="Absolute value">
45
+ <img src="" alt="Absolute value">
46
46
  <br>
47
47
  </div>
48
48
 
@@ -102,17 +102,15 @@ v = abs( NaN );
102
102
  <!-- eslint no-undef: "error" -->
103
103
 
104
104
  ```javascript
105
- var randu = require( '@stdlib/random-base-randu' );
106
- var round = require( '@stdlib/math-base-special-round' );
105
+ var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
106
+ var logEachMap = require( '@stdlib/console-log-each-map' );
107
107
  var abs = require( '@stdlib/math-base-special-abs' );
108
108
 
109
- var rand;
110
- var i;
109
+ var x = discreteUniform( 100, -100, 100, {
110
+ 'dtype': 'float64'
111
+ });
111
112
 
112
- for ( i = 0; i < 100; i++ ) {
113
- rand = round( randu() * 100.0 ) - 50.0;
114
- console.log( 'abs(%d) = %d', rand, abs( rand ) );
115
- }
113
+ logEachMap( 'abs(%d) = %d', x, abs );
116
114
  ```
117
115
 
118
116
  </section>
@@ -246,7 +244,7 @@ See [LICENSE][stdlib-license].
246
244
 
247
245
  ## Copyright
248
246
 
249
- Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
247
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
250
248
 
251
249
  </section>
252
250
 
@@ -259,8 +257,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
259
257
  [npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-special-abs.svg
260
258
  [npm-url]: https://npmjs.org/package/@stdlib/math-base-special-abs
261
259
 
262
- [test-image]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml/badge.svg?branch=v0.2.1
263
- [test-url]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml?query=branch:v0.2.1
260
+ [test-image]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml/badge.svg?branch=v0.2.3
261
+ [test-url]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml?query=branch:v0.2.3
264
262
 
265
263
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-abs/main.svg
266
264
  [coverage-url]: https://codecov.io/github/stdlib-js/math-base-special-abs?branch=main
@@ -272,8 +270,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
272
270
 
273
271
  -->
274
272
 
275
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
276
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
273
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
274
+ [chat-url]: https://stdlib.zulipchat.com
277
275
 
278
276
  [stdlib]: https://github.com/stdlib-js/stdlib
279
277
 
@@ -19,7 +19,7 @@
19
19
  // TypeScript Version: 4.1
20
20
 
21
21
  /**
22
- * Computes the absolute value of double-precision floating-point number `x`.
22
+ * Computes the absolute value of a double-precision floating-point number `x`.
23
23
  *
24
24
  * @param x - input value
25
25
  * @returns absolute value
@@ -16,9 +16,6 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- /**
20
- * Header file containing function declarations.
21
- */
22
19
  #ifndef STDLIB_MATH_BASE_SPECIAL_ABS_H
23
20
  #define STDLIB_MATH_BASE_SPECIAL_ABS_H
24
21
 
package/manifest.json CHANGED
@@ -1,75 +1,95 @@
1
1
  {
2
- "options": {
3
- "task": "build"
4
- },
5
- "fields": [
6
- {
7
- "field": "src",
8
- "resolve": true,
9
- "relative": true
10
- },
11
- {
12
- "field": "include",
13
- "resolve": true,
14
- "relative": true
15
- },
16
- {
17
- "field": "libraries",
18
- "resolve": false,
19
- "relative": false
20
- },
21
- {
22
- "field": "libpath",
23
- "resolve": true,
24
- "relative": false
25
- }
26
- ],
27
- "confs": [
28
- {
29
- "task": "build",
30
- "src": [
31
- "./src/main.c"
32
- ],
33
- "include": [
34
- "./include"
35
- ],
36
- "libraries": [],
37
- "libpath": [],
38
- "dependencies": [
39
- "@stdlib/math-base-napi-unary",
40
- "@stdlib/constants-float64-high-word-abs-mask",
2
+ "options": {
3
+ "task": "build",
4
+ "wasm": false
5
+ },
6
+ "fields": [
7
+ {
8
+ "field": "src",
9
+ "resolve": true,
10
+ "relative": true
11
+ },
12
+ {
13
+ "field": "include",
14
+ "resolve": true,
15
+ "relative": true
16
+ },
17
+ {
18
+ "field": "libraries",
19
+ "resolve": false,
20
+ "relative": false
21
+ },
22
+ {
23
+ "field": "libpath",
24
+ "resolve": true,
25
+ "relative": false
26
+ }
27
+ ],
28
+ "confs": [
29
+ {
30
+ "task": "build",
31
+ "wasm": false,
32
+ "src": [
33
+ "./src/main.c"
34
+ ],
35
+ "include": [
36
+ "./include"
37
+ ],
38
+ "libraries": [],
39
+ "libpath": [],
40
+ "dependencies": [
41
+ "@stdlib/math-base-napi-unary",
42
+ "@stdlib/constants-float64-high-word-abs-mask",
41
43
  "@stdlib/number-float64-base-to-words"
42
- ]
43
- },
44
- {
45
- "task": "benchmark",
46
- "src": [
47
- "./src/main.c"
48
- ],
49
- "include": [
50
- "./include"
51
- ],
52
- "libraries": [],
53
- "libpath": [],
54
- "dependencies": [
55
- "@stdlib/constants-float64-high-word-abs-mask",
44
+ ]
45
+ },
46
+ {
47
+ "task": "benchmark",
48
+ "wasm": false,
49
+ "src": [
50
+ "./src/main.c"
51
+ ],
52
+ "include": [
53
+ "./include"
54
+ ],
55
+ "libraries": [],
56
+ "libpath": [],
57
+ "dependencies": [
58
+ "@stdlib/constants-float64-high-word-abs-mask",
56
59
  "@stdlib/number-float64-base-to-words"
57
- ]
58
- },
59
- {
60
- "task": "examples",
61
- "src": [
62
- "./src/main.c"
63
- ],
64
- "include": [
65
- "./include"
66
- ],
67
- "libraries": [],
68
- "libpath": [],
69
- "dependencies": [
70
- "@stdlib/constants-float64-high-word-abs-mask",
60
+ ]
61
+ },
62
+ {
63
+ "task": "examples",
64
+ "wasm": false,
65
+ "src": [
66
+ "./src/main.c"
67
+ ],
68
+ "include": [
69
+ "./include"
70
+ ],
71
+ "libraries": [],
72
+ "libpath": [],
73
+ "dependencies": [
74
+ "@stdlib/constants-float64-high-word-abs-mask",
71
75
  "@stdlib/number-float64-base-to-words"
72
- ]
73
- }
74
- ]
76
+ ]
77
+ },
78
+ {
79
+ "task": "build",
80
+ "wasm": true,
81
+ "src": [
82
+ "./src/main.c"
83
+ ],
84
+ "include": [
85
+ "./include"
86
+ ],
87
+ "libraries": [],
88
+ "libpath": [],
89
+ "dependencies": [
90
+ "@stdlib/constants-float64-high-word-abs-mask",
91
+ "@stdlib/number-float64-base-to-words"
92
+ ]
93
+ }
94
+ ]
75
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/math-base-special-abs",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Compute the absolute value of a double-precision floating-point number.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -33,10 +33,10 @@
33
33
  "url": "https://github.com/stdlib-js/stdlib/issues"
34
34
  },
35
35
  "dependencies": {
36
- "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1",
37
- "@stdlib/math-base-napi-unary": "^0.2.1",
38
- "@stdlib/number-float64-base-to-words": "^0.2.1",
39
- "@stdlib/utils-library-manifest": "^0.2.1"
36
+ "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2",
37
+ "@stdlib/math-base-napi-unary": "^0.2.6",
38
+ "@stdlib/number-float64-base-to-words": "^0.2.2",
39
+ "@stdlib/utils-library-manifest": "^0.2.3"
40
40
  },
41
41
  "devDependencies": {},
42
42
  "engines": {
@@ -68,89 +68,6 @@
68
68
  "double",
69
69
  "double-precision"
70
70
  ],
71
- "__stdlib__": {
72
- "stability": "stable",
73
- "envs": {
74
- "node": true,
75
- "browser": true,
76
- "repl": true
77
- },
78
- "namespaces": {
79
- "repl": true,
80
- "parent": false
81
- },
82
- "namespace": false,
83
- "standalone": true,
84
- "c_api": true,
85
- "addon": false,
86
- "wasm": false,
87
- "cli": false,
88
- "benchmarks": {
89
- "c": true,
90
- "cephes": true,
91
- "cpp": false,
92
- "boost": false,
93
- "fortran": false,
94
- "python": true,
95
- "numpy": false,
96
- "scipy": false,
97
- "r": true,
98
- "julia": true,
99
- "js": true
100
- },
101
- "examples": {
102
- "c": true,
103
- "cpp": false,
104
- "fortran": false,
105
- "js": true
106
- },
107
- "dtype": "float64",
108
- "base_alias": "abs",
109
- "alias": "abs",
110
- "short_desc": "absolute value",
111
- "link_text": "absolute value",
112
- "domain": [
113
- {
114
- "min": "-infinity",
115
- "max": "infinity"
116
- }
117
- ],
118
- "rand": {
119
- "min": -10,
120
- "max": 10
121
- },
122
- "keywords": [
123
- "absolute",
124
- "value",
125
- "abs",
126
- "magnitude"
127
- ],
128
- "extra_keywords": [
129
- "math.abs"
130
- ],
131
- "example_values": [
132
- -2,
133
- 1,
134
- 3,
135
- -5,
136
- 4,
137
- 0,
138
- -1,
139
- -3,
140
- -3.14,
141
- 5.6,
142
- -9,
143
- -5.55,
144
- 3.5,
145
- 10,
146
- -9.99,
147
- 3,
148
- -6,
149
- -7,
150
- 8,
151
- -7.77
152
- ]
153
- },
154
71
  "funding": {
155
72
  "type": "opencollective",
156
73
  "url": "https://opencollective.com/stdlib"
package/include.gypi DELETED
@@ -1,53 +0,0 @@
1
- # @license Apache-2.0
2
- #
3
- # Copyright (c) 2018 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
- }