cc [ flag ... ] file ... -lsunmath -lm [ library ... ] #include <sunmath.h>
double sinp(double x);
float sinpf(float x);
long double sinpl(long double x);
double cosp(double x);
float cospf(float x);
long double cospl(long double x);
double tanp(double x);
float tanpf(float x);
long double tanpl(long double x);
void sincosp(double x, double *s, double *c);
void sincospf(float x, float *s, float *c);
void sincospl(long double x, long double *s, long double *c);
double asinp(double x);
float asinpf(float x);
long double asinpl(long double x);
double acosp(double x);
float acospf(float x);
long double acospl(long double x);
double atanp(double x);
float atanpf(float x);
long double atanpl(long double x);
sinp(x)、cosp(x) 和 tanp(x) 计算缩放到具有周期 2*PI 的三角函数,其中 PI 是 pi 的最佳浮点近似值:sinp(x) := sin(x * pi/PI),类似情况适用于 cosp(x) 和 tanp(x)。double 函数 sinp、cosp 和 tanp 使用 pi 的最佳双精度近似值。float 函数 sinpf、cospf 和 tanpf 使用 pi 的最佳单精度近似值。long double 函数 sinpl、cospl 和 tanpl 在 SPARC 上使用最佳四精度近似值,在 x86 上使用最佳扩展双精度近似值。对于大参数,这些函数的运行速度可能比使用 2pi 周期的标准三角函数快,但它们并不与 sinpi(3M) 中介绍的按 pi 比例缩放的三角函数一样快。
sincosp(x, s, c) 同时设置 *s = sinp(x) 以及 *c = cosp(x)。
对应的反函数在表面上计算 asinp(x) := asin(x) * PI/pi,类似情况适用于 acosp(x) 和 atanp(x);但是,由于 PI/pi 在最后位 1 中的某个单元内,因此这些函数实际仅分别返回未按比例缩放的值 asin(x)、acos(x) 和 atan(x)。
有关下列属性的说明,请参见 attributes(5):
|
asin(3M)、acos(3M)、atan(3M)、cos(3M)、sin(3M)、sincos(3M)、tan(3M)、sind(3M)、sinpi(3M)、attributes(5)