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 になるようにスケーリングされた三角関数 sinp(x) := sin(x * pi/PI) を計算します。PI は、pi の浮動小数点の最良近似です。cosp(x) と tanp(x) の場合も同様です。double 関数 sinp、cosp、および tanp は、pi の倍精度の最良近似を使用します。float 関数 sinpf、cospf、および tanpf は、pi の単精度の最良近似を使用します。long double 関数 sinpl、cospl、および tanpl は、SPARC の場合は 4 倍精度の最良近似を使用し、x86 の場合は拡張倍精度の最良近似を使用します。引数が大きい場合、これらの関数は周期が 2pi の標準の三角関数よりも速く実行できますが、pi でスケーリングされた三角関数ほどは速くありません (sinpi(3M) を参照)。
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)