@stdlib/math-base-special-abs
Advanced tools
@@ -22,3 +22,3 @@ /* | ||
| /** | ||
| * Computes the absolute value of double-precision floating-point number `x`. | ||
| * Computes the absolute value of a double-precision floating-point number `x`. | ||
| * | ||
@@ -25,0 +25,0 @@ * @param x - input value |
@@ -19,5 +19,2 @@ /** | ||
| /** | ||
| * Header file containing function declarations. | ||
| */ | ||
| #ifndef STDLIB_MATH_BASE_SPECIAL_ABS_H | ||
@@ -24,0 +21,0 @@ #define STDLIB_MATH_BASE_SPECIAL_ABS_H |
+90
-70
| { | ||
| "options": { | ||
| "task": "build" | ||
| }, | ||
| "fields": [ | ||
| { | ||
| "field": "src", | ||
| "resolve": true, | ||
| "relative": true | ||
| }, | ||
| { | ||
| "field": "include", | ||
| "resolve": true, | ||
| "relative": true | ||
| }, | ||
| { | ||
| "field": "libraries", | ||
| "resolve": false, | ||
| "relative": false | ||
| }, | ||
| { | ||
| "field": "libpath", | ||
| "resolve": true, | ||
| "relative": false | ||
| } | ||
| ], | ||
| "confs": [ | ||
| { | ||
| "task": "build", | ||
| "src": [ | ||
| "./src/main.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [ | ||
| "@stdlib/math-base-napi-unary", | ||
| "@stdlib/constants-float64-high-word-abs-mask", | ||
| "options": { | ||
| "task": "build", | ||
| "wasm": false | ||
| }, | ||
| "fields": [ | ||
| { | ||
| "field": "src", | ||
| "resolve": true, | ||
| "relative": true | ||
| }, | ||
| { | ||
| "field": "include", | ||
| "resolve": true, | ||
| "relative": true | ||
| }, | ||
| { | ||
| "field": "libraries", | ||
| "resolve": false, | ||
| "relative": false | ||
| }, | ||
| { | ||
| "field": "libpath", | ||
| "resolve": true, | ||
| "relative": false | ||
| } | ||
| ], | ||
| "confs": [ | ||
| { | ||
| "task": "build", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/main.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [ | ||
| "@stdlib/math-base-napi-unary", | ||
| "@stdlib/constants-float64-high-word-abs-mask", | ||
| "@stdlib/number-float64-base-to-words" | ||
| ] | ||
| }, | ||
| { | ||
| "task": "benchmark", | ||
| "src": [ | ||
| "./src/main.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [ | ||
| "@stdlib/constants-float64-high-word-abs-mask", | ||
| ] | ||
| }, | ||
| { | ||
| "task": "benchmark", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/main.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [ | ||
| "@stdlib/constants-float64-high-word-abs-mask", | ||
| "@stdlib/number-float64-base-to-words" | ||
| ] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "src": [ | ||
| "./src/main.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [ | ||
| "@stdlib/constants-float64-high-word-abs-mask", | ||
| ] | ||
| }, | ||
| { | ||
| "task": "examples", | ||
| "wasm": false, | ||
| "src": [ | ||
| "./src/main.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [ | ||
| "@stdlib/constants-float64-high-word-abs-mask", | ||
| "@stdlib/number-float64-base-to-words" | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| }, | ||
| { | ||
| "task": "build", | ||
| "wasm": true, | ||
| "src": [ | ||
| "./src/main.c" | ||
| ], | ||
| "include": [ | ||
| "./include" | ||
| ], | ||
| "libraries": [], | ||
| "libpath": [], | ||
| "dependencies": [ | ||
| "@stdlib/constants-float64-high-word-abs-mask", | ||
| "@stdlib/number-float64-base-to-words" | ||
| ] | ||
| } | ||
| ] | ||
| } |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Copyright (c) 2016-2024 The Stdlib Authors. | ||
| Copyright (c) 2016-2026 The Stdlib Authors. |
+3
-86
| { | ||
| "name": "@stdlib/math-base-special-abs", | ||
| "version": "0.2.2", | ||
| "version": "0.2.3", | ||
| "description": "Compute the absolute value of a double-precision floating-point number.", | ||
@@ -37,5 +37,5 @@ "license": "Apache-2.0", | ||
| "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2", | ||
| "@stdlib/math-base-napi-unary": "^0.2.3", | ||
| "@stdlib/math-base-napi-unary": "^0.2.6", | ||
| "@stdlib/number-float64-base-to-words": "^0.2.2", | ||
| "@stdlib/utils-library-manifest": "^0.2.2" | ||
| "@stdlib/utils-library-manifest": "^0.2.3" | ||
| }, | ||
@@ -72,85 +72,2 @@ "devDependencies": {}, | ||
| ], | ||
| "__stdlib__": { | ||
| "stability": "stable", | ||
| "envs": { | ||
| "node": true, | ||
| "browser": true, | ||
| "repl": true | ||
| }, | ||
| "namespaces": { | ||
| "repl": true, | ||
| "parent": false | ||
| }, | ||
| "namespace": false, | ||
| "standalone": true, | ||
| "c_api": true, | ||
| "addon": false, | ||
| "wasm": false, | ||
| "cli": false, | ||
| "benchmarks": { | ||
| "c": true, | ||
| "cephes": true, | ||
| "cpp": false, | ||
| "boost": false, | ||
| "fortran": false, | ||
| "python": true, | ||
| "numpy": false, | ||
| "scipy": false, | ||
| "r": true, | ||
| "julia": true, | ||
| "js": true | ||
| }, | ||
| "examples": { | ||
| "c": true, | ||
| "cpp": false, | ||
| "fortran": false, | ||
| "js": true | ||
| }, | ||
| "dtype": "float64", | ||
| "base_alias": "abs", | ||
| "alias": "abs", | ||
| "short_desc": "absolute value", | ||
| "link_text": "absolute value", | ||
| "domain": [ | ||
| { | ||
| "min": "-infinity", | ||
| "max": "infinity" | ||
| } | ||
| ], | ||
| "rand": { | ||
| "min": -10, | ||
| "max": 10 | ||
| }, | ||
| "keywords": [ | ||
| "absolute", | ||
| "value", | ||
| "abs", | ||
| "magnitude" | ||
| ], | ||
| "extra_keywords": [ | ||
| "math.abs" | ||
| ], | ||
| "example_values": [ | ||
| -2, | ||
| 1, | ||
| 3, | ||
| -5, | ||
| 4, | ||
| 0, | ||
| -1, | ||
| -3, | ||
| -3.14, | ||
| 5.6, | ||
| -9, | ||
| -5.55, | ||
| 3.5, | ||
| 10, | ||
| -9.99, | ||
| 3, | ||
| -6, | ||
| -7, | ||
| 8, | ||
| -7.77 | ||
| ] | ||
| }, | ||
| "funding": { | ||
@@ -157,0 +74,0 @@ "type": "opencollective", |
+13
-15
@@ -32,3 +32,3 @@ <!-- | ||
| # Absolute Value | ||
| # abs | ||
@@ -46,3 +46,3 @@ [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] --> | ||
| <div class="equation" align="center" data-raw-text="|x| = \begin{cases} x & \textrm{if}\ x \geq 0 \\ -x & \textrm{if}\ x < 0\end{cases}" data-equation="eq:absolute_value"> | ||
| <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"> | ||
| <img src="" alt="Absolute value"> | ||
| <br> | ||
@@ -107,13 +107,11 @@ </div> | ||
| ```javascript | ||
| var randu = require( '@stdlib/random-base-randu' ); | ||
| var round = require( '@stdlib/math-base-special-round' ); | ||
| var discreteUniform = require( '@stdlib/random-array-discrete-uniform' ); | ||
| var logEachMap = require( '@stdlib/console-log-each-map' ); | ||
| var abs = require( '@stdlib/math-base-special-abs' ); | ||
| var rand; | ||
| var i; | ||
| var x = discreteUniform( 100, -100, 100, { | ||
| 'dtype': 'float64' | ||
| }); | ||
| for ( i = 0; i < 100; i++ ) { | ||
| rand = round( randu() * 100.0 ) - 50.0; | ||
| console.log( 'abs(%d) = %d', rand, abs( rand ) ); | ||
| } | ||
| logEachMap( 'abs(%d) = %d', x, abs ); | ||
| ``` | ||
@@ -252,3 +250,3 @@ | ||
| Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. | ||
| Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors]. | ||
@@ -266,4 +264,4 @@ </section> | ||
| [test-image]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml/badge.svg?branch=v0.2.2 | ||
| [test-url]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml?query=branch:v0.2.2 | ||
| [test-image]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml/badge.svg?branch=v0.2.3 | ||
| [test-url]: https://github.com/stdlib-js/math-base-special-abs/actions/workflows/test.yml?query=branch:v0.2.3 | ||
@@ -280,4 +278,4 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-abs/main.svg | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
| [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im | ||
| [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg | ||
| [chat-url]: https://stdlib.zulipchat.com | ||
@@ -284,0 +282,0 @@ [stdlib]: https://github.com/stdlib-js/stdlib |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
424
4.95%0
-100%43598
-2.34%308
-0.65%- Removed