aboutsummaryrefslogtreecommitdiff
path: root/std/math/sin.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/sin.zig
parent06614b3fa09954464c2e2f32756cacedc178a282 (diff)
parent63a23e848a62d5f167f8d5478de9766cb24aa6eb (diff)
downloadzig-d2f5e57b68da0b16e5789ca19045ccbcb4ecfa8d.tar.gz
zig-d2f5e57b68da0b16e5789ca19045ccbcb4ecfa8d.zip
Merge branch 'master' into zen_stdlib
Diffstat (limited to 'std/math/sin.zig')
-rw-r--r--std/math/sin.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/std/math/sin.zig b/std/math/sin.zig
index 5dd869545b..3796d74812 100644
--- a/std/math/sin.zig
+++ b/std/math/sin.zig
@@ -19,20 +19,20 @@ pub fn sin(x: var) @typeOf(x) {
}
// sin polynomial coefficients
-const S0 = 1.58962301576546568060E-10;
+const S0 = 1.58962301576546568060E-10;
const S1 = -2.50507477628578072866E-8;
-const S2 = 2.75573136213857245213E-6;
+const S2 = 2.75573136213857245213E-6;
const S3 = -1.98412698295895385996E-4;
-const S4 = 8.33333333332211858878E-3;
+const S4 = 8.33333333332211858878E-3;
const S5 = -1.66666666666666307295E-1;
// cos polynomial coeffiecients
const C0 = -1.13585365213876817300E-11;
-const C1 = 2.08757008419747316778E-9;
+const C1 = 2.08757008419747316778E-9;
const C2 = -2.75573141792967388112E-7;
-const C3 = 2.48015872888517045348E-5;
+const C3 = 2.48015872888517045348E-5;
const C4 = -1.38888888888730564116E-3;
-const C5 = 4.16666666666665929218E-2;
+const C5 = 4.16666666666665929218E-2;
// NOTE: This is taken from the go stdlib. The musl implementation is much more complex.
//
@@ -60,7 +60,7 @@ fn sin32(x_: f32) f32 {
}
var y = math.floor(x * m4pi);
- var j = i64(y);
+ var j = @floatToInt(i64, y);
if (j & 1 == 1) {
j += 1;
@@ -112,7 +112,7 @@ fn sin64(x_: f64) f64 {
}
var y = math.floor(x * m4pi);
- var j = i64(y);
+ var j = @floatToInt(i64, y);
if (j & 1 == 1) {
j += 1;