Skip to content

Commit 5b084e0

Browse files
committed
fix: account for single-precision rounding when x is close to unity
1 parent edc9c69 commit 5b084e0

File tree

1 file changed

+1
-1
lines changed
  • lib/node_modules/@stdlib/math/base/special/acosf/lib

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function acosf( x ) {
9090
if ( isnanf( x ) ) {
9191
return NaN;
9292
}
93+
x = float64ToFloat32( x );
9394
if ( x < -1.0 || x > 1.0 ) {
9495
return NaN;
9596
}
@@ -99,7 +100,6 @@ function acosf( x ) {
99100
if ( x === -1.0 ) {
100101
return PI;
101102
}
102-
x = float64ToFloat32( x );
103103
ax = absf( x );
104104
if ( ax < 0.5 ) {
105105
if ( ax <= SMALL ) {

0 commit comments

Comments
 (0)