mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-03-01 06:41:15 +01:00
Added wasm binding to KalkNum.estimate()
This commit is contained in:
parent
8e16aa3f1a
commit
b526ca918d
@ -43,6 +43,12 @@ lazy_static! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl KalkNum {
|
impl KalkNum {
|
||||||
|
#[cfg(not(feature = "rug"))]
|
||||||
|
#[wasm_bindgen(js_name = estimate)]
|
||||||
|
pub fn estimate_js(&self) -> Option<String> {
|
||||||
|
self.estimate()
|
||||||
|
}
|
||||||
|
|
||||||
// Get an estimate of what the number is, eg. 3.141592 => π
|
// Get an estimate of what the number is, eg. 3.141592 => π
|
||||||
pub fn estimate(&self) -> Option<String> {
|
pub fn estimate(&self) -> Option<String> {
|
||||||
let fract = self.value.clone().fract().abs();
|
let fract = self.value.clone().fract().abs();
|
||||||
|
Loading…
Reference in New Issue
Block a user