Infinity: Difference between revisions

→‎{{header|Zig}}: Add note about float mode and add c_longdouble as tested type
(→‎{{header|Zig}}: Replace assertion with testing function, add missing types and checks (that were implemented since last change of Zig section), annotate versions.)
(→‎{{header|Zig}}: Add note about float mode and add c_longdouble as tested type)
Line 1,651:
=={{header|Zig}}==
 
'''Works with:''' 0.10.x, 0.11.x, 0.12.0-dev.15021577+b3462b7ce9ad03b628
 
Assumes that defaul float optimization mode was not changed via @setFloatMode (performed in Strict mode, not Optimized, latter is equivalent to -ffast-math).
 
<syntaxhighlight lang="zig">const std = @import("std");
Line 1,660 ⟶ 1,662:
const expect = std.testing.expect;
 
const float_types = [_]type{ f16, f32, f64, f80, f128, c_longdouble };
inline for (float_types) |T| {
const infinite_value: T = comptime std.math.inf(T);
28

edits