Skip to content

Commit 96534a3

Browse files
kgryteanandkaranubc
authored andcommitted
revert: fix: load correct float32 sqrt dependency
This commit reverts stdlib-js@d4be935 and adds a comment explaining why the double-precision `sqrt` is used. --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent e88de9a commit 96534a3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

lib/node_modules/@stdlib/math/base/special/rsqrtf/lib/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' );
5353
* // returns NaN
5454
*/
5555
function rsqrtf( x ) {
56+
// As the square root is a fundamental numerical operation, compute in extended precision in order to avoid precision loss:
5657
return float64ToFloat32( 1.0 / sqrt( float64ToFloat32( x ) ) );
5758
}
5859

lib/node_modules/@stdlib/math/base/special/rsqrtf/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"libpath": [],
4040
"dependencies": [
4141
"@stdlib/math/base/napi/unary",
42-
"@stdlib/math/base/special/sqrtf"
42+
"@stdlib/math/base/special/sqrt"
4343
]
4444
},
4545
{
@@ -55,7 +55,7 @@
5555
],
5656
"libpath": [],
5757
"dependencies": [
58-
"@stdlib/math/base/special/sqrtf"
58+
"@stdlib/math/base/special/sqrt"
5959
]
6060
},
6161
{
@@ -71,7 +71,7 @@
7171
],
7272
"libpath": [],
7373
"dependencies": [
74-
"@stdlib/math/base/special/sqrtf"
74+
"@stdlib/math/base/special/sqrt"
7575
]
7676
}
7777
]

lib/node_modules/@stdlib/math/base/special/rsqrtf/src/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
#include "stdlib/math/base/special/rsqrtf.h"
20-
#include "stdlib/math/base/special/sqrtf.h"
20+
#include "stdlib/math/base/special/sqrt.h"
2121

2222
/**
2323
* Computes the reciprocal square root of a single-precision floating-point number.
@@ -30,5 +30,6 @@
3030
* // returns 0.5
3131
*/
3232
float stdlib_base_rsqrtf( const float x ) {
33-
return 1.0f / stdlib_base_sqrtf( x );
33+
// As the square root is a fundamental numerical operation, compute in extended precision in order to avoid precision loss:
34+
return 1.0f / stdlib_base_sqrt( x );
3435
}

0 commit comments

Comments
 (0)