std/math: hide internal cos/tan functions

This commit is contained in:
Marc Tiehuis 2021-12-06 01:17:01 +13:00
parent d28b445329
commit b02384e03d
2 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ pub fn cos(x: anytype) @TypeOf(x) {
};
}
pub fn cos32(x: f32) f32 {
fn cos32(x: f32) f32 {
// Small multiples of pi/2 rounded to double precision.
const c1pio2: f64 = 1.0 * math.pi / 2.0; // 0x3FF921FB, 0x54442D18
const c2pio2: f64 = 2.0 * math.pi / 2.0; // 0x400921FB, 0x54442D18
@ -83,7 +83,7 @@ pub fn cos32(x: f32) f32 {
};
}
pub fn cos64(x: f64) f64 {
fn cos64(x: f64) f64 {
var ix = @bitCast(u64, x) >> 32;
ix &= 0x7fffffff;

View File

@ -28,7 +28,7 @@ pub fn tan(x: anytype) @TypeOf(x) {
};
}
pub fn tan32(x: f32) f32 {
fn tan32(x: f32) f32 {
// Small multiples of pi/2 rounded to double precision.
const t1pio2: f64 = 1.0 * math.pi / 2.0; // 0x3FF921FB, 0x54442D18
const t2pio2: f64 = 2.0 * math.pi / 2.0; // 0x400921FB, 0x54442D18
@ -72,7 +72,7 @@ pub fn tan32(x: f32) f32 {
return kernel.__tandf(y, n & 1 != 0);
}
pub fn tan64(x: f64) f64 {
fn tan64(x: f64) f64 {
var ix = @bitCast(u64, x) >> 32;
ix &= 0x7fffffff;