From b2f067e0b4c23d170fd1a76edd35a0e9a0e6ef0d Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 4 Dec 2023 08:55:21 -0800 Subject: [PATCH] stop erroring on subnormals, it's not really an issue --- src/integer.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/integer.rs b/src/integer.rs index 350454e..6775649 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -209,8 +209,8 @@ impl TryFrom for Ratio64{ std::num::FpCategory::Nan=>Err(Self::Error::Nan), std::num::FpCategory::Infinite=>Err(Self::Error::Infinite), std::num::FpCategory::Zero=>Ok(Self::ZERO), - std::num::FpCategory::Subnormal=>Err(Self::Error::Subnormal), - std::num::FpCategory::Normal=>ratio64_from_mes(integer_decode_f32(value)), + std::num::FpCategory::Subnormal + |std::num::FpCategory::Normal=>ratio64_from_mes(integer_decode_f32(value)), } } } @@ -222,8 +222,8 @@ impl TryFrom for Ratio64{ std::num::FpCategory::Nan=>Err(Self::Error::Nan), std::num::FpCategory::Infinite=>Err(Self::Error::Infinite), std::num::FpCategory::Zero=>Ok(Self::ZERO), - std::num::FpCategory::Subnormal=>Err(Self::Error::Subnormal), - std::num::FpCategory::Normal=>ratio64_from_mes(integer_decode_f64(value)), + std::num::FpCategory::Subnormal + |std::num::FpCategory::Normal=>ratio64_from_mes(integer_decode_f64(value)), } } } @@ -488,8 +488,8 @@ impl TryFrom for Planar64{ std::num::FpCategory::Nan=>Err(Self::Error::Nan), std::num::FpCategory::Infinite=>Err(Self::Error::Infinite), std::num::FpCategory::Zero=>Ok(Self::ZERO), - std::num::FpCategory::Subnormal=>Err(Self::Error::Subnormal), - std::num::FpCategory::Normal=>planar64_from_mes(integer_decode_f32(value)), + std::num::FpCategory::Subnormal + |std::num::FpCategory::Normal=>planar64_from_mes(integer_decode_f32(value)), } } } @@ -501,8 +501,8 @@ impl TryFrom for Planar64{ std::num::FpCategory::Nan=>Err(Self::Error::Nan), std::num::FpCategory::Infinite=>Err(Self::Error::Infinite), std::num::FpCategory::Zero=>Ok(Self::ZERO), - std::num::FpCategory::Subnormal=>Err(Self::Error::Subnormal), - std::num::FpCategory::Normal=>planar64_from_mes(integer_decode_f64(value)), + std::num::FpCategory::Subnormal + |std::num::FpCategory::Normal=>planar64_from_mes(integer_decode_f64(value)), } } }