Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

bufferSize

Public Function
std.fmt.float.bufferSize
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.

Params

File

fmt/float.zig:14
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,
        },
    };
}