diff options
| author | tgschultz <tgschultz@gmail.com> | 2018-05-11 21:36:02 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-11 21:36:02 -0500 |
| commit | 8c1872543c8cf76215cc4bf3ced4637bb1065a4e (patch) | |
| tree | 72dfebb643ab61579e3fb8dd58cd4610ffe876fa /std/math/exp.zig | |
| parent | 7186e92c86982950d0aa7c0c2deef9ef96bc1264 (diff) | |
| parent | 6e821078f625a03eb8b7794c983da0f7793366ab (diff) | |
| download | zig-8c1872543c8cf76215cc4bf3ced4637bb1065a4e.tar.gz zig-8c1872543c8cf76215cc4bf3ced4637bb1065a4e.zip | |
Merge pull request #1 from zig-lang/master
Sync with zig-lang/zig master
Diffstat (limited to 'std/math/exp.zig')
| -rw-r--r-- | std/math/exp.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/std/math/exp.zig b/std/math/exp.zig index 4032930a43..21aa558c57 100644 --- a/std/math/exp.zig +++ b/std/math/exp.zig @@ -6,6 +6,7 @@ const std = @import("../index.zig"); const math = std.math; const assert = std.debug.assert; +const builtin = @import("builtin"); pub fn exp(x: var) @typeOf(x) { const T = @typeOf(x); @@ -17,6 +18,8 @@ pub fn exp(x: var) @typeOf(x) { } fn exp32(x_: f32) f32 { + @setFloatMode(this, builtin.FloatMode.Strict); + const half = []f32 { 0.5, -0.5 }; const ln2hi = 6.9314575195e-1; const ln2lo = 1.4286067653e-6; @@ -94,6 +97,8 @@ fn exp32(x_: f32) f32 { } fn exp64(x_: f64) f64 { + @setFloatMode(this, builtin.FloatMode.Strict); + const half = []const f64 { 0.5, -0.5 }; const ln2hi: f64 = 6.93147180369123816490e-01; const ln2lo: f64 = 1.90821492927058770002e-10; |
