aboutsummaryrefslogtreecommitdiff
path: root/std/math/acos.zig
diff options
context:
space:
mode:
authorAndrea Orru <andrea@orru.io>2018-08-06 01:43:19 -0400
committerAndrea Orru <andrea@orru.io>2018-08-06 01:43:19 -0400
commitd2f5e57b68da0b16e5789ca19045ccbcb4ecfa8d (patch)
treee9fa3caec533a0d1e2b434868b2fde1f9240e5c8 /std/math/acos.zig
parent06614b3fa09954464c2e2f32756cacedc178a282 (diff)
parent63a23e848a62d5f167f8d5478de9766cb24aa6eb (diff)
downloadzig-d2f5e57b68da0b16e5789ca19045ccbcb4ecfa8d.tar.gz
zig-d2f5e57b68da0b16e5789ca19045ccbcb4ecfa8d.zip
Merge branch 'master' into zen_stdlib
Diffstat (limited to 'std/math/acos.zig')
-rw-r--r--std/math/acos.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/std/math/acos.zig b/std/math/acos.zig
index a4f08af306..54844e8f6e 100644
--- a/std/math/acos.zig
+++ b/std/math/acos.zig
@@ -16,7 +16,7 @@ pub fn acos(x: var) @typeOf(x) {
}
fn r32(z: f32) f32 {
- const pS0 = 1.6666586697e-01;
+ const pS0 = 1.6666586697e-01;
const pS1 = -4.2743422091e-02;
const pS2 = -8.6563630030e-03;
const qS1 = -7.0662963390e-01;
@@ -74,16 +74,16 @@ fn acos32(x: f32) f32 {
}
fn r64(z: f64) f64 {
- const pS0: f64 = 1.66666666666666657415e-01;
+ const pS0: f64 = 1.66666666666666657415e-01;
const pS1: f64 = -3.25565818622400915405e-01;
- const pS2: f64 = 2.01212532134862925881e-01;
+ const pS2: f64 = 2.01212532134862925881e-01;
const pS3: f64 = -4.00555345006794114027e-02;
- const pS4: f64 = 7.91534994289814532176e-04;
- const pS5: f64 = 3.47933107596021167570e-05;
+ const pS4: f64 = 7.91534994289814532176e-04;
+ const pS5: f64 = 3.47933107596021167570e-05;
const qS1: f64 = -2.40339491173441421878e+00;
- const qS2: f64 = 2.02094576023350569471e+00;
+ const qS2: f64 = 2.02094576023350569471e+00;
const qS3: f64 = -6.88283971605453293030e-01;
- const qS4: f64 = 7.70381505559019352791e-02;
+ const qS4: f64 = 7.70381505559019352791e-02;
const p = z * (pS0 + z * (pS1 + z * (pS2 + z * (pS3 + z * (pS4 + z * pS5)))));
const q = 1.0 + z * (qS1 + z * (qS2 + z * (qS3 + z * qS4)));
@@ -95,12 +95,12 @@ fn acos64(x: f64) f64 {
const pio2_lo: f64 = 6.12323399573676603587e-17;
const ux = @bitCast(u64, x);
- const hx = u32(ux >> 32);
+ const hx = @intCast(u32, ux >> 32);
const ix = hx & 0x7FFFFFFF;
// |x| >= 1 or nan
if (ix >= 0x3FF00000) {
- const lx = u32(ux & 0xFFFFFFFF);
+ const lx = @intCast(u32, ux & 0xFFFFFFFF);
// acos(1) = 0, acos(-1) = pi
if ((ix - 0x3FF00000) | lx == 0) {