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

floatFromUnsigned

Public Function
std.fmt.parse_float.common.floatFromUnsigned
pub fn floatFromUnsigned(comptime T: type, comptime MantissaT: type, v: MantissaT) T

Params

  • T: type
  • MantissaT: type
  • v: MantissaT

File

fmt/parse_float/common.zig:47
47
48
49
50
51
52
53
54
55
56
pub fn floatFromUnsigned(comptime T: type, comptime MantissaT: type, v: MantissaT) T {
    return switch (T) {
        f16 => @as(f16, @bitCast(@as(u16, @truncate(v)))),
        f32 => @as(f32, @bitCast(@as(u32, @truncate(v)))),
        f64 => @as(f64, @bitCast(@as(u64, @truncate(v)))),
        f80 => @as(f80, @bitCast(@as(u80, @truncate(v)))),
        f128 => @as(f128, @bitCast(v)),
        else => unreachable,
    };
}