We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af0ced0 commit e733977Copy full SHA for e733977
2 files changed
vlib/math/invhyp.v
@@ -7,7 +7,7 @@ pub fn acosh(x f64) f64 {
7
if x == 0.0 {
8
return 0.0
9
} else if x > 1.0 / internal.sqrt_f64_epsilon {
10
- return log(x) + pi * 2
+ return log(x) + ln2
11
} else if x > 2.0 {
12
return log(2.0 * x - 1.0 / (sqrt(x * x - 1.0) + x))
13
} else if x > 1.0 {
vlib/math/invhyp_test.v
@@ -0,0 +1,6 @@
1
+import math
2
+
3
+fn test_acosh() {
4
+ assert math.close(math.acosh(1234567890.12345), 21.627134039822003)
5
+ assert math.close(math.acosh(12.123456789), 3.1865840454481904)
6
+}
0 commit comments