Open
Description
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
const std = @import("std");
pub fn main() !void {
const foo = 0.0;
std.debug.print("foo / foo std.math.isnan({d:.2}) = {any}\n", .{ foo, std.math.isNan(foo / foo) });
const bar: f32 = 0.0;
std.debug.print("bar / bar std.math.isnan({d:.2}) = {any}\n", .{ bar, std.math.isNan(bar / bar) });
}
OUTPUT:
foo / foo std.math.isnan(0.00) = false
bar / bar std.math.isnan(0.00) = true
Expected Behavior
I would expect comptime_float
and f32
would result in the same output of true
.