mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-11 13:28:28 +00:00
Disallow Scalar
value being NaN
This commit is contained in:
parent
1da2844030
commit
02e1ae05f4
@ -7,6 +7,10 @@ pub struct Scalar {
|
|||||||
|
|
||||||
impl Scalar {
|
impl Scalar {
|
||||||
pub fn new(value: f64) -> Self {
|
pub fn new(value: f64) -> Self {
|
||||||
|
if value.is_nan() {
|
||||||
|
panic!("`Scalar` value must not be NaN");
|
||||||
|
}
|
||||||
|
|
||||||
Self { value }
|
Self { value }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user