diff options
Diffstat (limited to 'library/compiler-builtins/libm/src/math/truncf16.rs')
| -rw-r--r-- | library/compiler-builtins/libm/src/math/truncf16.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/library/compiler-builtins/libm/src/math/truncf16.rs b/library/compiler-builtins/libm/src/math/truncf16.rs new file mode 100644 index 00000000000..d7c3d225cf9 --- /dev/null +++ b/library/compiler-builtins/libm/src/math/truncf16.rs @@ -0,0 +1,7 @@ +/// Rounds the number toward 0 to the closest integral value (f16). +/// +/// This effectively removes the decimal part of the number, leaving the integral part. +#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] +pub fn truncf16(x: f16) -> f16 { + super::generic::trunc(x) +} |
