| ... | @@ -112,17 +112,17 @@ pub fn FloatRepr(comptime Float: type) type { | ... | @@ -112,17 +112,17 @@ pub fn FloatRepr(comptime Float: type) type { |
| 112 | /// This currently truncates denormal values, which needs to be fixed before this can be used to | 112 | /// This currently truncates denormal values, which needs to be fixed before this can be used to |
| 113 | /// produce a rounded value. | 113 | /// produce a rounded value. |
| 114 | pub fn reconstruct(normalized: Normalized, sign: std.math.Sign) Float { | 114 | pub fn reconstruct(normalized: Normalized, sign: std.math.Sign) Float { |
| 115 | if (normalized.exponent > BiasedExponent.max_normal.unbias()) return @bitCast(Repr{ | 115 | if (normalized.exponent > comptime BiasedExponent.max_normal.unbias()) return @bitCast(Repr{ |
| 116 | .mantissa = 0, | 116 | .mantissa = 0, |
| 117 | .exponent = .infinite, | 117 | .exponent = .infinite, |
| 118 | .sign = sign, | 118 | .sign = sign, |
| 119 | }); | 119 | }); |
| 120 | const mantissa = @as(Mantissa, 1 << fractional_bits) | normalized.fraction; | 120 | const mantissa = @as(Mantissa, 1 << fractional_bits) | normalized.fraction; |
| 121 | if (normalized.exponent < BiasedExponent.min_normal.unbias()) return @bitCast(Repr{ | 121 | if (normalized.exponent < comptime BiasedExponent.min_normal.unbias()) return @bitCast(Repr{ |
| 122 | .mantissa = @truncate(std.math.shr( | 122 | .mantissa = @truncate(std.math.shr( |
| 123 | Mantissa, | 123 | Mantissa, |
| 124 | mantissa, | 124 | mantissa, |
| 125 | BiasedExponent.min_normal.unbias() - normalized.exponent, | 125 | (comptime BiasedExponent.min_normal.unbias()) - normalized.exponent, |
| 126 | )), | 126 | )), |
| 127 | .exponent = .denormal, | 127 | .exponent = .denormal, |
| 128 | .sign = sign, | 128 | .sign = sign, |