135678Sbostic /* 2*61068Sbostic * Copyright (c) 1985, 1990, 1993 3*61068Sbostic * The Regents of the University of California. All rights reserved. 435678Sbostic * 542613Sbostic * %sccs.include.redist.c% 635678Sbostic * 7*61068Sbostic * @(#)math.h 8.1 (Berkeley) 06/02/93 835678Sbostic */ 912186Ssam 1047552Sdonn #ifndef _MATH_H_ 1147552Sdonn #define _MATH_H_ 1247552Sdonn 1347735Sbostic #if defined(vax) || defined(tahoe) /* DBL_MAX from float.h */ 1447735Sbostic #define HUGE_VAL 1.701411834604692294E+38 1546415Sdonn #else 1647725Sbostic #define HUGE_VAL 1e500 /* IEEE: positive infinity */ 1746415Sdonn #endif 1835678Sbostic 1946415Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 2047735Sbostic #if defined(vax) || defined(tahoe) 2147735Sbostic /* 2247735Sbostic * HUGE for the VAX and Tahoe converts to the largest possible F-float value. 2347735Sbostic * This implies an understanding of the conversion behavior of atof(3). It 2447735Sbostic * was defined to be the largest float so that overflow didn't occur when it 2547735Sbostic * was assigned to a single precision number. HUGE_VAL is strongly preferred. 2647735Sbostic */ 2747735Sbostic #define HUGE 1.701411733192644270E+38 2847735Sbostic #else 2947713Sbostic #define HUGE HUGE_VAL 3046415Sdonn #endif 3146281Sbostic 3247725Sbostic #define M_E 2.7182818284590452354 /* e */ 3347725Sbostic #define M_LOG2E 1.4426950408889634074 /* log 2e */ 3447725Sbostic #define M_LOG10E 0.43429448190325182765 /* log 10e */ 3547725Sbostic #define M_LN2 0.69314718055994530942 /* log e2 */ 3647725Sbostic #define M_LN10 2.30258509299404568402 /* log e10 */ 3747725Sbostic #define M_PI 3.14159265358979323846 /* pi */ 3847725Sbostic #define M_PI_2 1.57079632679489661923 /* pi/2 */ 3947725Sbostic #define M_PI_4 0.78539816339744830962 /* pi/4 */ 4047725Sbostic #define M_1_PI 0.31830988618379067154 /* 1/pi */ 4147725Sbostic #define M_2_PI 0.63661977236758134308 /* 2/pi */ 4247725Sbostic #define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ 4347725Sbostic #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ 4447725Sbostic #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ 4557889Sbostic #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ 4647725Sbostic 4746415Sdonn #include <sys/cdefs.h> 4846281Sbostic 4946415Sdonn __BEGIN_DECLS 5052806Storek __pure double acos __P((double)); 5152806Storek __pure double asin __P((double)); 5252806Storek __pure double atan __P((double)); 5352806Storek __pure double atan2 __P((double, double)); 5452806Storek __pure double ceil __P((double)); 5552806Storek __pure double cos __P((double)); 5652806Storek __pure double cosh __P((double)); 5752806Storek __pure double exp __P((double)); 5852806Storek __pure double fabs __P((double)); 5952806Storek __pure double floor __P((double)); 6052806Storek __pure double fmod __P((double, double)); 6152806Storek double frexp __P((double, int *)); 6252806Storek __pure double ldexp __P((double, int)); 6352806Storek __pure double log __P((double)); 6452806Storek __pure double log10 __P((double)); 6552806Storek double modf __P((double, double *)); 6652806Storek __pure double pow __P((double, double)); 6752806Storek __pure double sin __P((double)); 6852806Storek __pure double sinh __P((double)); 6952806Storek __pure double sqrt __P((double)); 7052806Storek __pure double tan __P((double)); 7152806Storek __pure double tanh __P((double)); 7246415Sdonn 7346415Sdonn #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 7452806Storek __pure double acosh __P((double)); 7552806Storek __pure double asinh __P((double)); 7652806Storek __pure double atanh __P((double)); 7752806Storek double cabs(); /* we can't describe cabs()'s argument properly */ 7852806Storek __pure double cbrt __P((double)); 7952806Storek __pure double copysign __P((double, double)); 8052806Storek __pure double drem __P((double, double)); 8152806Storek __pure double erf __P((double)); 8252806Storek __pure double erfc __P((double)); 8352806Storek __pure double expm1 __P((double)); 8452806Storek __pure int finite __P((double)); 8552806Storek __pure double hypot __P((double, double)); 8635678Sbostic #if defined(vax) || defined(tahoe) 8752806Storek __pure double infnan __P((int)); 8847713Sbostic #endif 8952806Storek __pure int isinf __P((double)); 9052806Storek __pure int isnan __P((double)); 9152806Storek __pure double j0 __P((double)); 9252806Storek __pure double j1 __P((double)); 9352806Storek __pure double jn __P((int, double)); 9452806Storek __pure double lgamma __P((double)); 9552806Storek __pure double log1p __P((double)); 9652806Storek __pure double logb __P((double)); 9752806Storek __pure double rint __P((double)); 9852806Storek __pure double scalb __P((double, int)); 9952806Storek __pure double y0 __P((double)); 10052806Storek __pure double y1 __P((double)); 10152806Storek __pure double yn __P((int, double)); 10246415Sdonn #endif 10346415Sdonn 10446415Sdonn __END_DECLS 10547552Sdonn 10647552Sdonn #endif /* _MATH_H_ */ 107