From 61df5bc142253b0d33b77bceecfaef4c767e7feb Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 30 Jun 2018 01:44:54 +0200 Subject: [PATCH] add std.math f16 constants refs #1122 --- std/math/index.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/std/math/index.zig b/std/math/index.zig index 04133dc1dc..e987274f71 100644 --- a/std/math/index.zig +++ b/std/math/index.zig @@ -19,6 +19,12 @@ pub const f32_max = 3.40282346638528859812e+38; pub const f32_epsilon = 1.1920928955078125e-07; pub const f32_toint = 1.0 / f32_epsilon; +pub const f16_true_min = 0.000000059604644775390625; // 2**-24 +pub const f16_min = 0.00006103515625; // 2**-14 +pub const f16_max = 65504; +pub const f16_epsilon = 0.0009765625; // 2**-10 +pub const f16_toint = 1.0 / f16_epsilon; + pub const nan_u32 = u32(0x7F800001); pub const nan_f32 = @bitCast(f32, nan_u32);