/*
 * $Header: /smsa/bsd:include/math.h:bsd  1.8  $
 * $Source: /smsa/bsd:include/math.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 */
/*	math.h	4.6	9/11/85	*/

#ifndef __math_h
#define __math_h

#ifndef HUGE_VAL
#  define HUGE_VAL __huge_val
extern const double HUGE_VAL;
#endif

extern double acos(double /*x*/);
extern double asin(double /*x*/);
extern double atan(double /*x*/);
extern double atan2(double /*y*/, double /*x*/);

extern double cos(double /*x*/);
extern double sin(double /*x*/);
extern double tan(double /*x*/);

extern double cosh(double /*x*/);
extern double sinh(double /*x*/);
extern double tanh(double /*x*/);

extern double exp(double /*x*/);
extern double frexp(double /*value*/, int * /*exp*/);
extern double ldexp(double /*x*/, int /*exp*/);
extern double log(double /*x*/);
extern double log10(double /*x*/);
extern double modf(double /*value*/, double * /*iptr*/);

extern double pow(double /*x*/, double /*y*/);
extern double sqrt(double /*x*/);

extern double ceil(double /*x*/);
extern double fabs(double /*x*/);
extern double floor(double /*x*/);
extern double fmod(double /*x*/, double /*y*/);

#if defined(_XOPEN_C) || defined(_BSD_C)
extern double erf(double /*x*/), erfc(double /*x*/);
extern double gamma(double /*x*/);
extern double hypot(double /*x*/, double /*y*/);
extern double j0(double /*x*/), j1(double /*x*/), jn(int /*n*/, double /*x*/);
extern double y0(double /*x*/), y1(double /*x*/), yn(int /*n*/, double /*x*/);
#endif

#if defined(_XOPEN_C)
extern int isnan(double /*x*/);
extern int signgam;
extern double lgamma(double /*x*/);

#define M_E        2.718281828459045235360287471352
#define M_LOG2E    1.442695040888963407359924681002
#define M_LOG10E   0.434294481903251827651128918916
#define M_LN2      0.693147180559945309417232121458
#define M_LN10     2.302585092994045684017991454684
#define M_PI       3.141592653589793238462643383276
#define M_PI_2     1.570796326794896619231321691638
#define M_PI_4     0.785398163397448309615660845819
#define M_1_PI     0.318309886183790671537767526745
#define M_2_PI     0.636619772367581343075535053490
#define M_2_SQRTPI 1.128379167095512573896158903122
#define M_SQRT2    1.414213562373095048801688724209
#define M_SQRT1_2  0.707106781186547524400844362105
#define MAXFLOAT   3.4028234664E+38F
#endif

#if defined(_BSD_C)
extern double asinh(double /*x*/), acosh(double /*x*/), atanh(double /*x*/);
extern double expm1(double /*x*/), log1p(double /*x*/);
extern double rint(double /*x*/);
extern double cabs(double /*x*/);
extern double copysign(double /*x*/, double /*y*/);
extern double drem(double /*x*/, double /*y*/);
extern double logb(double /*x*/), scalb(double /*x*/, int /*n*/);
extern int finite(double /*x*/);
extern double cbrt(double /*x*/);
extern double atof(const char * /*p*/);

#define HUGE	1.79769313486231571e+308
#endif

/* The following item is set when library maths functions cause errors */
extern int __math_fsr;
#define _FSR_IVO		(1 << 0)	/* invalid operation*/
#define _FSR_DVZ		(1 << 1)	/* divide by zero */
#define _FSR_OFL		(1 << 2)	/* result overflow */
#define _FSR_UFL		(1 << 3)	/* result underflow */
#define _FSR_INX		(1 << 4)	/* inexact result */

#endif
