From 9799ef3062096a7fecc94ce0b599fefbd2ad7ded Mon Sep 17 00:00:00 2001 From: William Leader <83631101+wdlea@users.noreply.github.com> Date: Tue, 21 Jan 2025 12:03:33 +1300 Subject: [PATCH] Changed $M::MIN into $M::MIN_POSITIVE in the impl_real! macro. The docs for the function state "The smallest finite positive value representable using this type.", but f32::MIN & f64::MIN are both the smallest values representable(and are thus negative). It appears impl_real! is only ever used for f32 and f64, both of which have the "::MIN_VALUE constant. This change makes the functionality of the ::min_value() method consistent with the docs. --- src/scalar/real.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scalar/real.rs b/src/scalar/real.rs index b65dbe2..cc594a8 100644 --- a/src/scalar/real.rs +++ b/src/scalar/real.rs @@ -105,7 +105,7 @@ macro_rules! impl_real ( /// The smallest finite positive value representable using this type. #[inline] fn min_value() -> Option { - Some($M::MIN) + Some($M::MIN_POSITIVE) } /// The largest finite positive value representable using this type.