@stdlib/math-base-special-copysignf 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 +1 -1
- package/README.md +13 -16
- package/manifest.json +73 -73
- package/package.json +8 -8
- package/src/addon.c +0 -1
- package/include.gypi +0 -53
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -95,21 +95,18 @@ z = copysignf( -0.0, 1.0 );
|
|
|
95
95
|
<!-- eslint no-undef: "error" -->
|
|
96
96
|
|
|
97
97
|
```javascript
|
|
98
|
-
var
|
|
98
|
+
var uniform = require( '@stdlib/random-array-uniform' );
|
|
99
|
+
var logEachMap = require( '@stdlib/console-log-each-map' );
|
|
99
100
|
var copysignf = require( '@stdlib/math-base-special-copysignf' );
|
|
100
101
|
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var
|
|
102
|
+
var opts = {
|
|
103
|
+
'dtype': 'float32'
|
|
104
|
+
};
|
|
105
|
+
var x = uniform( 100, -50.0, 50.0, opts );
|
|
106
|
+
var y = uniform( 100, -5.0, 5.0, opts );
|
|
105
107
|
|
|
106
108
|
// Generate random numbers `x` and `y` and copy the sign of `y` to `x`...
|
|
107
|
-
|
|
108
|
-
x = (randu()*100.0) - 50.0;
|
|
109
|
-
y = (randu()*10.0) - 5.0;
|
|
110
|
-
z = copysignf( x, y );
|
|
111
|
-
console.log( 'x: %d, y: %d => %d', x, y, z );
|
|
112
|
-
}
|
|
109
|
+
logEachMap( 'x: %0.4f, y: %0.4f => %0.4f', x, y, copysignf );
|
|
113
110
|
```
|
|
114
111
|
|
|
115
112
|
</section>
|
|
@@ -246,7 +243,7 @@ See [LICENSE][stdlib-license].
|
|
|
246
243
|
|
|
247
244
|
## Copyright
|
|
248
245
|
|
|
249
|
-
Copyright © 2016-
|
|
246
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
250
247
|
|
|
251
248
|
</section>
|
|
252
249
|
|
|
@@ -259,8 +256,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
259
256
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-special-copysignf.svg
|
|
260
257
|
[npm-url]: https://npmjs.org/package/@stdlib/math-base-special-copysignf
|
|
261
258
|
|
|
262
|
-
[test-image]: https://github.com/stdlib-js/math-base-special-copysignf/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
263
|
-
[test-url]: https://github.com/stdlib-js/math-base-special-copysignf/actions/workflows/test.yml?query=branch:v0.2.
|
|
259
|
+
[test-image]: https://github.com/stdlib-js/math-base-special-copysignf/actions/workflows/test.yml/badge.svg?branch=v0.2.3
|
|
260
|
+
[test-url]: https://github.com/stdlib-js/math-base-special-copysignf/actions/workflows/test.yml?query=branch:v0.2.3
|
|
264
261
|
|
|
265
262
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-copysignf/main.svg
|
|
266
263
|
[coverage-url]: https://codecov.io/github/stdlib-js/math-base-special-copysignf?branch=main
|
|
@@ -272,8 +269,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
272
269
|
|
|
273
270
|
-->
|
|
274
271
|
|
|
275
|
-
[chat-image]: https://img.shields.io/
|
|
276
|
-
[chat-url]: https://
|
|
272
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
273
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
277
274
|
|
|
278
275
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
279
276
|
|
package/manifest.json
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
+
"-lm"
|
|
38
|
+
],
|
|
39
|
+
"libpath": [],
|
|
40
|
+
"dependencies": [
|
|
41
41
|
"@stdlib/math-base-napi-binary",
|
|
42
42
|
"@stdlib/constants-float32-abs-mask",
|
|
43
43
|
"@stdlib/constants-float32-sign-mask",
|
|
44
|
-
|
|
44
|
+
"@stdlib/number-float32-base-to-word",
|
|
45
45
|
"@stdlib/number-float32-base-from-word"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"task": "benchmark",
|
|
50
|
+
"src": [
|
|
51
|
+
"./src/main.c"
|
|
52
|
+
],
|
|
53
|
+
"include": [
|
|
54
|
+
"./include"
|
|
55
|
+
],
|
|
56
|
+
"libraries": [
|
|
57
|
+
"-lm"
|
|
58
|
+
],
|
|
59
|
+
"libpath": [],
|
|
60
|
+
"dependencies": [
|
|
61
61
|
"@stdlib/constants-float32-abs-mask",
|
|
62
62
|
"@stdlib/constants-float32-sign-mask",
|
|
63
63
|
"@stdlib/number-float32-base-to-word",
|
|
64
64
|
"@stdlib/number-float32-base-from-word"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"task": "examples",
|
|
69
|
+
"src": [
|
|
70
|
+
"./src/main.c"
|
|
71
|
+
],
|
|
72
|
+
"include": [
|
|
73
|
+
"./include"
|
|
74
|
+
],
|
|
75
|
+
"libraries": [
|
|
76
|
+
"-lm"
|
|
77
|
+
],
|
|
78
|
+
"libpath": [],
|
|
79
|
+
"dependencies": [
|
|
80
80
|
"@stdlib/constants-float32-abs-mask",
|
|
81
81
|
"@stdlib/constants-float32-sign-mask",
|
|
82
82
|
"@stdlib/number-float32-base-to-word",
|
|
83
83
|
"@stdlib/number-float32-base-from-word"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/math-base-special-copysignf",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Return a single-precision floating-point number with the magnitude of x and the sign of y.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@stdlib/constants-float32-abs-mask": "^0.2.
|
|
37
|
-
"@stdlib/constants-float32-sign-mask": "^0.2.
|
|
38
|
-
"@stdlib/math-base-napi-binary": "^0.
|
|
39
|
-
"@stdlib/number-float32-base-from-word": "^0.2.
|
|
40
|
-
"@stdlib/number-float32-base-to-word": "^0.2.
|
|
41
|
-
"@stdlib/number-float64-base-to-float32": "^0.2.
|
|
42
|
-
"@stdlib/utils-library-manifest": "^0.2.
|
|
36
|
+
"@stdlib/constants-float32-abs-mask": "^0.2.3",
|
|
37
|
+
"@stdlib/constants-float32-sign-mask": "^0.2.3",
|
|
38
|
+
"@stdlib/math-base-napi-binary": "^0.3.3",
|
|
39
|
+
"@stdlib/number-float32-base-from-word": "^0.2.2",
|
|
40
|
+
"@stdlib/number-float32-base-to-word": "^0.2.2",
|
|
41
|
+
"@stdlib/number-float64-base-to-float32": "^0.2.2",
|
|
42
|
+
"@stdlib/utils-library-manifest": "^0.2.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {},
|
|
45
45
|
"engines": {
|
package/src/addon.c
CHANGED
package/include.gypi
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# @license Apache-2.0
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) 2021 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
|
-
}
|