mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-31 17:09:13 +01:00
Added wasm binding to KalkNum.estimate()
This commit is contained in:
parent
93830090b5
commit
cc776367fa
@ -43,6 +43,12 @@ lazy_static! {
|
||||
}
|
||||
|
||||
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 => π
|
||||
pub fn estimate(&self) -> Option<String> {
|
||||
let fract = self.value.clone().fract().abs();
|
||||
|
Loading…
Reference in New Issue
Block a user