Casting u32 to f64 creates an error loop.
fn print_float(int: u32) void {
const cast_float = @intCast(int);
const explicit_float: f64 = @intCast(int);
const as_float = @as(f64, int);
const as_cast_float = @as(f64, @intCast(int));
std.debug.print("{f}\n", .{any_of_the_above});
}
Printing cast_float produces
error: @intCast must have a known result type.
Printing explicit_float produces
error: expected integer or vector, found ‘f64’ // in @intCast
Printing as_float produces
error: expected type ‘f64’, found ‘u32’ // in @as
Printing as_cast_float produces
error: expected integer or vector, found ‘f64’ // in @intCast