mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 22:41:24 +00:00
Implement Math.min() and Math.max() bindings (#542)
* Add Number.isNaN() binding * Add binding for Math.hypot() * Implement Math.min() and Math.max() bindings
This commit is contained in:
committed by
Alex Crichton
parent
f437e06463
commit
cefe1681ab
@ -1191,6 +1191,18 @@ extern "C" {
|
||||
#[wasm_bindgen(static_method_of = Math)]
|
||||
pub fn log2(x: f64) -> f64;
|
||||
|
||||
/// The Math.max() function returns the largest of two numbers.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max
|
||||
#[wasm_bindgen(static_method_of = Math)]
|
||||
pub fn max(x: f64, y: f64) -> f64;
|
||||
|
||||
/// The static function Math.min() returns the lowest-valued number passed into it.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/min
|
||||
#[wasm_bindgen(static_method_of = Math)]
|
||||
pub fn min(x: f64, y: f64) -> f64;
|
||||
|
||||
/// The Math.pow() function returns the base to the exponent power, that is, base^exponent.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/pow
|
||||
|
Reference in New Issue
Block a user