From a93b908ae028d8e9facc0046e0400a7562d09fd3 Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 26 Dec 2018 12:50:00 -0500 Subject: [PATCH 1/3] Added is_finite method for real --- alga/src/general/real.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/alga/src/general/real.rs b/alga/src/general/real.rs index d9c3688..43934f6 100644 --- a/alga/src/general/real.rs +++ b/alga/src/general/real.rs @@ -109,6 +109,8 @@ pub trait Real: fn log10_e() -> Self; fn ln_2() -> Self; fn ln_10() -> Self; + + fn is_finite(&self) -> bool; } macro_rules! impl_real( @@ -412,6 +414,10 @@ macro_rules! impl_real( fn ln_10() -> Self { $M::consts::LN_10 } + + fn is_finite(&self) -> bool { + $M::is_finite(*self) + } } )*) ); From 779d22bfa29125e7cbe3d7d18d4de9de9a56495d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Lupien=20=28Jojolepro=29?= Date: Tue, 22 Jan 2019 20:01:12 -0500 Subject: [PATCH 2/3] Added default bound on Real --- alga/src/general/real.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/alga/src/general/real.rs b/alga/src/general/real.rs index 43934f6..3a559fb 100644 --- a/alga/src/general/real.rs +++ b/alga/src/general/real.rs @@ -50,6 +50,7 @@ pub trait Real: + Debug + Display + Bounded + + Default { // NOTE: a real must be bounded because, no matter the chosen representation, being `Copy` implies that it occupies a statically-known size, meaning that it must have min/max values. fn floor(self) -> Self; From b51368463a491cf957cd43023730287cd44e25b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Lupien=20=28Jojolepro=29?= Date: Sat, 16 Feb 2019 03:21:00 -0500 Subject: [PATCH 3/3] Removed Default trait bound from Real. --- alga/src/general/real.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/alga/src/general/real.rs b/alga/src/general/real.rs index 3a559fb..43934f6 100644 --- a/alga/src/general/real.rs +++ b/alga/src/general/real.rs @@ -50,7 +50,6 @@ pub trait Real: + Debug + Display + Bounded - + Default { // NOTE: a real must be bounded because, no matter the chosen representation, being `Copy` implies that it occupies a statically-known size, meaning that it must have min/max values. fn floor(self) -> Self;