zig/doc/langref/float_mode_obj.zig

16 lines
270 B
Zig
Raw Normal View History

const std = @import("std");
const big = @as(f64, 1 << 40);
export fn foo_strict(x: f64) f64 {
return x + big - big;
}
export fn foo_optimized(x: f64) f64 {
@setFloatMode(.optimized);
return x + big - big;
}
// obj
// optimize=ReleaseFast
// disable_cache