Function bufferSize [src]

Returns the minimum buffer size needed to print every float of a specific type and format.

Prototype

pub fn bufferSize(comptime mode: Format, comptime T: type) comptime_int

Parameters

mode: FormatT: type

Source

pub fn bufferSize(comptime mode: Format, 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, }, }; }