File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,14 @@ extern {
266
266
#[ wasm_bindgen( static_method_of = Math ) ]
267
267
pub fn asin ( number : i32 ) -> Number ;
268
268
269
+ /// The Math.asinh() function returns the hyperbolic arcsine of a
270
+ /// number, that is Math.asinh(x) = arsinh(x) = the unique y such that sinh(y) = x
271
+ ///
272
+ /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/asinh
273
+ #[ wasm_bindgen( static_method_of = Math ) ]
274
+ pub fn asinh ( number : i32 ) -> Number ;
275
+
276
+
269
277
}
270
278
271
279
// Number.
Original file line number Diff line number Diff line change @@ -108,3 +108,29 @@ fn asin() {
108
108
"# )
109
109
. test ( )
110
110
}
111
+
112
+ #[ test]
113
+ fn asinh ( ) {
114
+ project ( )
115
+ . file ( "src/lib.rs" , r#"
116
+ #![feature(proc_macro, wasm_custom_section)]
117
+
118
+ extern crate wasm_bindgen;
119
+ use wasm_bindgen::prelude::*;
120
+ use wasm_bindgen::js;
121
+
122
+ #[wasm_bindgen]
123
+ pub fn asinh(number: i32) -> js::Number {
124
+ js::Math::asinh(number)
125
+ }
126
+ "# )
127
+ . file ( "test.ts" , r#"
128
+ import * as assert from "assert";
129
+ import * as wasm from "./out";
130
+
131
+ export function test() {
132
+ assert.equal(wasm.asinh(1), Math.asinh(1));
133
+ }
134
+ "# )
135
+ . test ( )
136
+ }
You can’t perform that action at this time.
0 commit comments