1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

math: allow acos(0) (fix #13876) (#13877)

This commit is contained in:
kylepritchard 2022-03-30 19:36:50 +01:00 committed by GitHub
parent ae1cb5697e
commit 6137ce23c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,9 +206,6 @@ pub fn acos(x f64) f64 {
if (x < -1.0) || (x > 1.0) {
return nan()
}
if x == 0.0 {
return nan()
}
if x > 0.5 {
return f64(2.0) * asin(sqrt(0.5 - 0.5 * x))
}