dashu_base/math/inv.rs
1use super::Inverse;
2
3impl Inverse for f32 {
4 type Output = f32;
5 #[inline]
6 fn inv(self) -> f32 {
7 1.0 / self
8 }
9}
10
11impl Inverse for &f32 {
12 type Output = f32;
13 #[inline]
14 fn inv(self) -> f32 {
15 1.0 / *self
16 }
17}
18
19impl Inverse for f64 {
20 type Output = f64;
21 #[inline]
22 fn inv(self) -> f64 {
23 1.0 / self
24 }
25}
26
27impl Inverse for &f64 {
28 type Output = f64;
29 #[inline]
30 fn inv(self) -> f64 {
31 1.0 / *self
32 }
33}