Upstream magiclen/byte-unit state of the touched files before 4d115cc977

This commit is contained in:
upstream committed 2026-09-04 09:45:03 +02:00
1 parent 2219c475f1
commit 85f79fa753
2 files changed
+2 -24

No files matched your search

+2 -14
View File
@@ -36,13 +36,7 @@ pub(crate) fn ceil_f64(v: f64) -> f64 {
pub(crate) fn ceil_f64(v: f64) -> f64 {
debug_assert!(v >= 0.0);
// `Decimal::from_f64` returns `None` for non-finite values (e.g. infinity),
// so fall back to the input to mirror `f64::ceil` in the `std` path and
// avoid panicking.
match Decimal::from_f64(v) {
Some(d) => d.ceil().to_f64().unwrap_or(v),
None => v,
}
Decimal::from_f64(v).unwrap().ceil().to_f64().unwrap()
}
#[cfg(any(feature = "byte", feature = "bit"))]
@@ -60,13 +54,7 @@ pub(crate) fn ceil_f32(v: f32) -> f32 {
pub(crate) fn ceil_f32(v: f32) -> f32 {
debug_assert!(v >= 0.0);
// `Decimal::from_f32` returns `None` for non-finite values (e.g. infinity),
// so fall back to the input to mirror `f32::ceil` in the `std` path and
// avoid panicking.
match Decimal::from_f32(v) {
Some(d) => d.ceil().to_f32().unwrap_or(v),
None => v,
}
Decimal::from_f32(v).unwrap().ceil().to_f32().unwrap()
}
#[cfg(any(feature = "byte", feature = "bit"))]