| author | |
| committer | |
| log | b837855317c3f73248e1ea4f3cad6b06d2568443 |
| tree | ceea08463a9eb32979d67c471765f7deccd8de0f |
| parent | 5aa35f62c391d34b92445388c5d645d87f9c4621 |
Replaces two magic numbers with the procedure used to generate them, in order to keep consistent with other implementations for f64 & f128.1 files changed, 2 insertions(+), 2 deletions(-)
lib/std/math/fabs.zig+2-2| ... | ... | @@ -27,13 +27,13 @@ pub fn fabs(x: anytype) @TypeOf(x) { |
| 27 | 27 | |
| 28 | 28 | fn fabs16(x: f16) f16 { |
| 29 | 29 | var u = @bitCast(u16, x); |
| 30 | u &= 0x7FFF; | |
| 30 | u &= maxInt(u16) >> 1; | |
| 31 | 31 | return @bitCast(f16, u); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | fn fabs32(x: f32) f32 { |
| 35 | 35 | var u = @bitCast(u32, x); |
| 36 | u &= 0x7FFFFFFF; | |
| 36 | u &= maxInt(u32) >> 1; | |
| 37 | 37 | return @bitCast(f32, u); |
| 38 | 38 | } |
| 39 | 39 |