mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
std/math: hide internal cos/tan functions
This commit is contained in:
parent
d28b445329
commit
b02384e03d
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user