pub fn bufferSize(comptime mode: Mode, comptime T: type) comptime_int
Returns the minimum buffer size needed to print every float of a specific type and format.
mode: Mode
T: type
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
pub fn bufferSize(comptime mode: Mode, comptime T: type) comptime_int { comptime std.debug.assert(@typeInfo(T) == .float); return switch (mode) { .scientific => 53, // Based on minimum subnormal values. .decimal => switch (@bitSizeOf(T)) { 16 => @max(15, min_buffer_size), 32 => 55, 64 => 347, 80 => 4996, 128 => 5011, else => unreachable, }, }; }
Returns the minimum buffer size needed to print every float of a specific type and format.