| 1 | /// Rounds the number toward 0 to the closest integral value (f64). |
|---|---|
| 2 | /// |
| 3 | /// This effectively removes the decimal part of the number, leaving the integral part. |
| 4 | #[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] |
| 5 | pub fn trunc(x: f64) -> f64 { |
| 6 | select_implementation! { |
| 7 | name: trunc, |
| 8 | use_arch: all(target_arch = "wasm32", intrinsics_enabled), |
| 9 | args: x, |
| 10 | } |
| 11 | |
| 12 | super::generic::trunc(x) |
| 13 | } |
| 14 |
