| ▲ | fph 2 hours ago | ||||||||||||||||
The article quickly mentions implementing addition: ``` impl Add for NonZeroF32 { ... } impl Add<f32> for NonZeroF32 { ... } impl Add<NonZeroF32> for f32 { ... } ``` What type would it return though? | |||||||||||||||||
| ▲ | alfons_foobar an hour ago | parent [-] | ||||||||||||||||
Would have to be F32, no? I cannot think of any way to enforce "non-zero-ness" of the result without making it return an optional Result<NonZeroF32>, and at that point we are basically back to square one... | |||||||||||||||||
| |||||||||||||||||