authorgravatar for shawn@git.icuShawn Landden <shawn@git.icu> 2018-08-29 17:38:46-07:00
committergravatar for shawn@git.icuShawn Landden <shawn@git.icu> 2018-09-08 03:52:28+00:00
logf8808edff479426a04685ac6f2b487376eaab65a
tree55819183688206b3c07b22492fd76e5d0db3b601
parent342cff28f5033887ac9c2e8b02da9067e8ad2f3d

simplify f64_min to equivilent value

arm64 complains about the old value (I added a test)

1 files changed, 7 insertions(+), 1 deletions(-)

std/math/index.zig+7-1
...@@ -8,7 +8,7 @@ pub const pi = 3.14159265358979323846264338327950288419716939937510;...@@ -8,7 +8,7 @@ pub const pi = 3.14159265358979323846264338327950288419716939937510;
88
9// float.h details9// float.h details
10pub const f64_true_min = 4.94065645841246544177e-324;10pub const f64_true_min = 4.94065645841246544177e-324;
11pub const f64_min = 2.22507385850720138309e-308;11pub const f64_min = 2.2250738585072014e-308;
12pub const f64_max = 1.79769313486231570815e+308;12pub const f64_max = 1.79769313486231570815e+308;
13pub const f64_epsilon = 2.22044604925031308085e-16;13pub const f64_epsilon = 2.22044604925031308085e-16;
14pub const f64_toint = 1.0 / f64_epsilon;14pub const f64_toint = 1.0 / f64_epsilon;
...@@ -650,3 +650,9 @@ pub fn lossyCast(comptime T: type, value: var) T {...@@ -650,3 +650,9 @@ pub fn lossyCast(comptime T: type, value: var) T {
650 else => @compileError("bad type"),650 else => @compileError("bad type"),
651 }651 }
652}652}
653
654test "math.f64_min" {
655 const f64_min_u64 = 0x0010000000000000;
656 const fmin: f64 = f64_min;
657 assert(@bitCast(u64, fmin) == f64_min_u64);
658}