Skip to content

Commit 3b17d52

Browse files
committed
Fix for NaN values
1 parent 5b417cf commit 3b17d52

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc/utils/MPFRWrapper/MPCommon.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ MPFRNumber MPFRNumber::acospi() const {
7878
mpfr_acospi(result.value, value, mpfr_rounding);
7979
return result;
8080
#else
81+
if (result.is_nan()) {
82+
return result;
83+
}
8184
mpfr_acos(result.value, value, mpfr_rounding);
8285
MPFRNumber value_pi(0.0, 1280);
8386
mpfr_const_pi(value_pi.value, MPFR_RNDN);

0 commit comments

Comments
 (0)