@stdlib/math-base-special-cabs
Advanced tools
| { | ||
| "version": 3, | ||
| "sources": ["../lib/main.js", "../lib/index.js"], | ||
| "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hypot = require( '@stdlib/math-base-special-hypot' );\nvar real = require( '@stdlib/complex-float64-real' );\nvar imag = require( '@stdlib/complex-float64-imag' );\n\n\n// MAIN //\n\n/**\n* Computes the absolute value of a double-precision complex floating-point number.\n*\n* @param {Complex128} z - complex number\n* @returns {number} absolute value\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var v = cabs( new Complex128( 5.0, 3.0 ) );\n* // returns ~5.83\n*/\nfunction cabs( z ) {\n\t// TODO: consider whether to use C99 rules for special cases involving infinities and nans (see https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Objects/complexobject.c#L191)\n\treturn hypot( real( z ), imag( z ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cabs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the absolute value of a double-precision complex floating-point number.\n*\n* @module @stdlib/math-base-special-cabs\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n* var cabs = require( '@stdlib/math-base-special-cabs' );\n*\n* var v = cabs( new Complex128( 5.0, 3.0 ) );\n* // returns ~5.83\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], | ||
| "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EACnDC,EAAO,QAAS,8BAA+B,EAC/CC,EAAO,QAAS,8BAA+B,EAiBnD,SAASC,EAAMC,EAAI,CAElB,OAAOJ,EAAOC,EAAMG,CAAE,EAAGF,EAAME,CAAE,CAAE,CACpC,CAKAL,EAAO,QAAUI,ICdjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", | ||
| "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar hypot = require( '@stdlib/math-base-special-hypot' );\nvar real = require( '@stdlib/complex-float64-real' );\nvar imag = require( '@stdlib/complex-float64-imag' );\n\n\n// MAIN //\n\n/**\n* Computes the absolute value of a double-precision complex floating-point number.\n*\n* @param {Complex128} z - complex number\n* @returns {number} absolute value\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n*\n* var v = cabs( new Complex128( 5.0, 3.0 ) );\n* // returns ~5.83\n*/\nfunction cabs( z ) {\n\treturn hypot( real( z ), imag( z ) );\n}\n\n\n// EXPORTS //\n\nmodule.exports = cabs;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Compute the absolute value of a double-precision complex floating-point number.\n*\n* @module @stdlib/math-base-special-cabs\n*\n* @example\n* var Complex128 = require( '@stdlib/complex-float64-ctor' );\n* var cabs = require( '@stdlib/math-base-special-cabs' );\n*\n* var v = cabs( new Complex128( 5.0, 3.0 ) );\n* // returns ~5.83\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], | ||
| "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAQ,QAAS,iCAAkC,EACnDC,EAAO,QAAS,8BAA+B,EAC/CC,EAAO,QAAS,8BAA+B,EAiBnD,SAASC,EAAMC,EAAI,CAClB,OAAOJ,EAAOC,EAAMG,CAAE,EAAGF,EAAME,CAAE,CAAE,CACpC,CAKAL,EAAO,QAAUI,ICbjB,IAAIE,EAAO,IAKX,OAAO,QAAUA", | ||
| "names": ["require_main", "__commonJSMin", "exports", "module", "hypot", "real", "imag", "cabs", "z", "main"] | ||
| } |
+0
-1
@@ -43,3 +43,2 @@ /** | ||
| function cabs( z ) { | ||
| // TODO: consider whether to use C99 rules for special cases involving infinities and nans (see https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Objects/complexobject.c#L191) | ||
| return hypot( real( z ), imag( z ) ); | ||
@@ -46,0 +45,0 @@ } |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Copyright (c) 2016-2024 The Stdlib Authors. | ||
| Copyright (c) 2016-2026 The Stdlib Authors. |
+7
-7
| { | ||
| "name": "@stdlib/math-base-special-cabs", | ||
| "version": "0.2.2", | ||
| "version": "0.2.3", | ||
| "description": "Compute the absolute value of a double-precision complex floating-point number.", | ||
@@ -36,9 +36,9 @@ "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@stdlib/complex-float64-ctor": "^0.0.3", | ||
| "@stdlib/complex-float64-ctor": "^0.1.1", | ||
| "@stdlib/complex-float64-imag": "^0.1.1", | ||
| "@stdlib/complex-float64-real": "^0.1.1", | ||
| "@stdlib/complex-float64-reim": "^0.1.2", | ||
| "@stdlib/math-base-napi-unary": "^0.2.3", | ||
| "@stdlib/math-base-special-hypot": "^0.2.1", | ||
| "@stdlib/utils-library-manifest": "^0.2.2" | ||
| "@stdlib/complex-float64-real": "^0.1.2", | ||
| "@stdlib/complex-float64-reim": "^0.1.3", | ||
| "@stdlib/math-base-napi-unary": "^0.2.7", | ||
| "@stdlib/math-base-special-hypot": "^0.2.4", | ||
| "@stdlib/utils-library-manifest": "^0.2.3" | ||
| }, | ||
@@ -45,0 +45,0 @@ "devDependencies": {}, |
+6
-6
@@ -203,3 +203,3 @@ <!-- | ||
| stdlib_complex128_reim( v, &re, &im ); | ||
| printf( "f(%lf + %lf) = %lf\n", re, im, y ); | ||
| printf( "cabs(%lf + %lfi) = %lf\n", re, im, y ); | ||
| } | ||
@@ -258,3 +258,3 @@ } | ||
| Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors]. | ||
| Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors]. | ||
@@ -272,4 +272,4 @@ </section> | ||
| [test-image]: https://github.com/stdlib-js/math-base-special-cabs/actions/workflows/test.yml/badge.svg?branch=v0.2.2 | ||
| [test-url]: https://github.com/stdlib-js/math-base-special-cabs/actions/workflows/test.yml?query=branch:v0.2.2 | ||
| [test-image]: https://github.com/stdlib-js/math-base-special-cabs/actions/workflows/test.yml/badge.svg?branch=v0.2.3 | ||
| [test-url]: https://github.com/stdlib-js/math-base-special-cabs/actions/workflows/test.yml?query=branch:v0.2.3 | ||
@@ -286,4 +286,4 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-special-cabs/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 | ||
@@ -290,0 +290,0 @@ [stdlib]: https://github.com/stdlib-js/stdlib |
+0
-1
@@ -22,3 +22,2 @@ /** | ||
| // cppcheck-suppress shadowFunction | ||
| STDLIB_MATH_BASE_NAPI_MODULE_Z_D( stdlib_base_cabs ) |
39056
-1.19%237
-0.42%- Removed
- Removed