mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
14 lines
493 B
Zig
14 lines
493 B
Zig
const divCeil = @import("std").math.divCeil;
|
|
const common = @import("./common.zig");
|
|
const floatFromBigInt = @import("./float_from_int.zig").floatFromBigInt;
|
|
|
|
pub const panic = common.panic;
|
|
|
|
comptime {
|
|
@export(&__floatuneihf, .{ .name = "__floatuneihf", .linkage = common.linkage, .visibility = common.visibility });
|
|
}
|
|
|
|
pub fn __floatuneihf(a: [*]const u32, bits: usize) callconv(.c) f16 {
|
|
return floatFromBigInt(f16, .unsigned, a[0 .. divCeil(usize, bits, 32) catch unreachable]);
|
|
}
|