authorgravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2021-12-06 01:17:01+13:00
committergravatar for marc@tiehu.isMarc Tiehuis <marc@tiehu.is> 2021-12-06 01:17:01+13:00
logb02384e03d1e52d72ccf7dd7d3cec30f05b51082
tree8be172a00da57d14f7fac8b5b4b46a8f141951d4
parentd28b445329fbee865a10568e997241079d4d71e4

std/math: hide internal cos/tan functions


2 files changed, 4 insertions(+), 4 deletions(-)

lib/std/math/cos.zig+2-2
...@@ -26,7 +26,7 @@ pub fn cos(x: anytype) @TypeOf(x) {...@@ -26,7 +26,7 @@ pub fn cos(x: anytype) @TypeOf(x) {
26 };26 };
27}27}
2828
29pub fn cos32(x: f32) f32 {29fn cos32(x: f32) f32 {
30 // Small multiples of pi/2 rounded to double precision.30 // Small multiples of pi/2 rounded to double precision.
31 const c1pio2: f64 = 1.0 * math.pi / 2.0; // 0x3FF921FB, 0x54442D1831 const c1pio2: f64 = 1.0 * math.pi / 2.0; // 0x3FF921FB, 0x54442D18
32 const c2pio2: f64 = 2.0 * math.pi / 2.0; // 0x400921FB, 0x54442D1832 const c2pio2: f64 = 2.0 * math.pi / 2.0; // 0x400921FB, 0x54442D18
...@@ -83,7 +83,7 @@ pub fn cos32(x: f32) f32 {...@@ -83,7 +83,7 @@ pub fn cos32(x: f32) f32 {
83 };83 };
84}84}
8585
86pub fn cos64(x: f64) f64 {86fn cos64(x: f64) f64 {
87 var ix = @bitCast(u64, x) >> 32;87 var ix = @bitCast(u64, x) >> 32;
88 ix &= 0x7fffffff;88 ix &= 0x7fffffff;
8989
lib/std/math/tan.zig+2-2
...@@ -28,7 +28,7 @@ pub fn tan(x: anytype) @TypeOf(x) {...@@ -28,7 +28,7 @@ pub fn tan(x: anytype) @TypeOf(x) {
28 };28 };
29}29}
3030
31pub fn tan32(x: f32) f32 {31fn tan32(x: f32) f32 {
32 // Small multiples of pi/2 rounded to double precision.32 // Small multiples of pi/2 rounded to double precision.
33 const t1pio2: f64 = 1.0 * math.pi / 2.0; // 0x3FF921FB, 0x54442D1833 const t1pio2: f64 = 1.0 * math.pi / 2.0; // 0x3FF921FB, 0x54442D18
34 const t2pio2: f64 = 2.0 * math.pi / 2.0; // 0x400921FB, 0x54442D1834 const t2pio2: f64 = 2.0 * math.pi / 2.0; // 0x400921FB, 0x54442D18
...@@ -72,7 +72,7 @@ pub fn tan32(x: f32) f32 {...@@ -72,7 +72,7 @@ pub fn tan32(x: f32) f32 {
72 return kernel.__tandf(y, n & 1 != 0);72 return kernel.__tandf(y, n & 1 != 0);
73}73}
7474
75pub fn tan64(x: f64) f64 {75fn tan64(x: f64) f64 {
76 var ix = @bitCast(u64, x) >> 32;76 var ix = @bitCast(u64, x) >> 32;
77 ix &= 0x7fffffff;77 ix &= 0x7fffffff;
7878