fn floatBits(comptime Type: type) !void Type: type303
304
305
306
307
308
309
310
311
312fn floatBits(comptime Type: type) !void {
// (1 +) for the sign bit, since it is separate from the other bits
const size = 1 + floatExponentBits(Type) + floatMantissaBits(Type);
try expect(@bitSizeOf(Type) == size);
try expect(floatFractionalBits(Type) <= floatMantissaBits(Type));
// for machine epsilon, assert expmin <= -prec <= expmax
try expect(floatExponentMin(Type) <= -floatFractionalBits(Type));
try expect(-floatFractionalBits(Type) <= floatExponentMax(Type));
}