File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,14 @@ extern {
250
250
#[ wasm_bindgen( static_method_of = Math ) ]
251
251
pub fn acos ( adjacent : i32 , hypotenuse : i32 ) -> Number ;
252
252
253
+ /// The Math.acosh() function returns the hyperbolic arc-cosine of a
254
+ /// number, that is ∀x ≥ 1
255
+ /// Math.acosh(x) = arcosh(x) = the unique y ≥ 0 such that cosh(y) = x
256
+ ///
257
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/acosh
258
+ #[ wasm_bindgen( static_method_of = Math ) ]
259
+ pub fn acosh ( number : i32 ) -> Number ;
260
+
253
261
}
254
262
255
263
// Number.
Original file line number Diff line number Diff line change @@ -55,3 +55,30 @@ fn acos() {
55
55
"# )
56
56
. test ( )
57
57
}
58
+
59
+ #[ test]
60
+ fn acosh ( ) {
61
+ project ( )
62
+ . file ( "src/lib.rs" , r#"
63
+ #![feature(proc_macro, wasm_custom_section)]
64
+
65
+ extern crate wasm_bindgen;
66
+ use wasm_bindgen::prelude::*;
67
+ use wasm_bindgen::js;
68
+
69
+ #[wasm_bindgen]
70
+ pub fn acosh(number: i32) -> js::Number {
71
+ js::Math::acosh(number)
72
+ }
73
+ "# )
74
+ . file ( "test.ts" , r#"
75
+ import * as assert from "assert";
76
+ import * as wasm from "./out";
77
+
78
+ export function test() {
79
+ assert.equal(wasm.acosh(1), 0);
80
+ assert.equal(wasm.acosh(2), Math.acosh(2));
81
+ }
82
+ "# )
83
+ . test ( )
84
+ }
You can’t perform that action at this time.
0 commit comments