about summary refs log tree commit diff
path: root/library/compiler-builtins/libm/src/math/truncf128.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/compiler-builtins/libm/src/math/truncf128.rs')
-rw-r--r--library/compiler-builtins/libm/src/math/truncf128.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/compiler-builtins/libm/src/math/truncf128.rs b/library/compiler-builtins/libm/src/math/truncf128.rs
new file mode 100644
index 00000000000..9dccc0d0e9d
--- /dev/null
+++ b/library/compiler-builtins/libm/src/math/truncf128.rs
@@ -0,0 +1,7 @@
+/// Rounds the number toward 0 to the closest integral value (f128).
+///
+/// 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 truncf128(x: f128) -> f128 {
+    super::generic::trunc(x)
+}