2 stable releases
new 29.0.1 | Jan 21, 2025 |
---|---|
29.0.0 | Jan 20, 2025 |
#1519 in WebAssembly
5,803 downloads per month
Used in 26 crates
(2 directly)
10KB
251 lines
A minimal helper crate for implementing float-related operations for WebAssembly in terms of the native platform primitives.
This crate is intended to assist with solving the portability issues such as:
- Functions like
f32::trunc
are not available in#![no_std]
targets. - The
f32::trunc
function is likely faster than thelibm
fallback. - Behavior of
f32::trunc
differs across platforms, for example it's different on Windows and glibc on Linux. Additionally riscv64's implementation oflibm
seems to have different NaN behavior than other platforms. - Some wasm functions are in the Rust standard library, but not stable yet.
There are a few locations throughout the codebase that these functions are needed so they're implemented only in a single location here rather than multiple.
Dependencies
~395KB