125c28e8Piotr Jasiukajtis/*
225c28e8Piotr Jasiukajtis * CDDL HEADER START
325c28e8Piotr Jasiukajtis *
425c28e8Piotr Jasiukajtis * The contents of this file are subject to the terms of the
525c28e8Piotr Jasiukajtis * Common Development and Distribution License (the "License").
625c28e8Piotr Jasiukajtis * You may not use this file except in compliance with the License.
725c28e8Piotr Jasiukajtis *
825c28e8Piotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
925c28e8Piotr Jasiukajtis * or http://www.opensolaris.org/os/licensing.
1025c28e8Piotr Jasiukajtis * See the License for the specific language governing permissions
1125c28e8Piotr Jasiukajtis * and limitations under the License.
1225c28e8Piotr Jasiukajtis *
1325c28e8Piotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each
1425c28e8Piotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1525c28e8Piotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the
1625c28e8Piotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying
1725c28e8Piotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner]
1825c28e8Piotr Jasiukajtis *
1925c28e8Piotr Jasiukajtis * CDDL HEADER END
2025c28e8Piotr Jasiukajtis */
2125c28e8Piotr Jasiukajtis/*
2225c28e8Piotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
2325c28e8Piotr Jasiukajtis */
2425c28e8Piotr Jasiukajtis/*
2525c28e8Piotr Jasiukajtis * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
2625c28e8Piotr Jasiukajtis * Use is subject to license terms.
2725c28e8Piotr Jasiukajtis */
2825c28e8Piotr Jasiukajtis
2925c28e8Piotr Jasiukajtis#ifndef _ISO_MATH_ISO_H
3025c28e8Piotr Jasiukajtis#define	_ISO_MATH_ISO_H
3125c28e8Piotr Jasiukajtis
3225c28e8Piotr Jasiukajtis#include <sys/feature_tests.h>
3325c28e8Piotr Jasiukajtis
3425c28e8Piotr Jasiukajtis#ifdef __cplusplus
3525c28e8Piotr Jasiukajtisextern "C" {
3625c28e8Piotr Jasiukajtis#endif
3725c28e8Piotr Jasiukajtis
3825c28e8Piotr Jasiukajtis#if !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && !defined(__C99FEATURES__)
3925c28e8Piotr Jasiukajtistypedef union _h_val {
4025c28e8Piotr Jasiukajtis	unsigned long _i[sizeof (double) / sizeof (unsigned long)];
4125c28e8Piotr Jasiukajtis	double _d;
4225c28e8Piotr Jasiukajtis} _h_val;
4325c28e8Piotr Jasiukajtis
4425c28e8Piotr Jasiukajtis#ifdef __STDC__
4525c28e8Piotr Jasiukajtisextern const _h_val __huge_val;
4625c28e8Piotr Jasiukajtis#else
4725c28e8Piotr Jasiukajtisextern _h_val __huge_val;
4825c28e8Piotr Jasiukajtis#endif
4925c28e8Piotr Jasiukajtis#undef	HUGE_VAL
5025c28e8Piotr Jasiukajtis#define	HUGE_VAL __huge_val._d
5125c28e8Piotr Jasiukajtis#endif	/* !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && ... */
5225c28e8Piotr Jasiukajtis
5325c28e8Piotr Jasiukajtis#if __cplusplus >= 199711L
5425c28e8Piotr Jasiukajtisnamespace std {
5525c28e8Piotr Jasiukajtis#endif
5625c28e8Piotr Jasiukajtis
579938df9Richard Loweextern double acos(double);
589938df9Richard Loweextern double asin(double);
599938df9Richard Loweextern double atan(double);
609938df9Richard Loweextern double atan2(double, double);
619938df9Richard Loweextern double cos(double);
629938df9Richard Loweextern double sin(double);
639938df9Richard Loweextern double tan(double);
649938df9Richard Lowe
659938df9Richard Loweextern double cosh(double);
669938df9Richard Loweextern double sinh(double);
679938df9Richard Loweextern double tanh(double);
689938df9Richard Lowe
699938df9Richard Loweextern double exp(double);
709938df9Richard Loweextern double frexp(double, int *);
719938df9Richard Loweextern double ldexp(double, int);
729938df9Richard Loweextern double log(double);
739938df9Richard Loweextern double log10(double);
749938df9Richard Loweextern double modf(double, double *);
759938df9Richard Lowe
769938df9Richard Loweextern double pow(double, double);
779938df9Richard Loweextern double sqrt(double);
789938df9Richard Lowe
799938df9Richard Loweextern double ceil(double);
809938df9Richard Loweextern double fabs(double);
819938df9Richard Loweextern double floor(double);
829938df9Richard Loweextern double fmod(double, double);
8325c28e8Piotr Jasiukajtis
8425c28e8Piotr Jasiukajtis#if defined(__MATHERR_ERRNO_DONTCARE)
8525c28e8Piotr Jasiukajtis#pragma does_not_read_global_data(acos, asin, atan, atan2)
8625c28e8Piotr Jasiukajtis#pragma does_not_read_global_data(cos, sin, tan, cosh, sinh, tanh)
8725c28e8Piotr Jasiukajtis#pragma does_not_read_global_data(exp, log, log10, pow, sqrt)
8825c28e8Piotr Jasiukajtis#pragma does_not_read_global_data(frexp, ldexp, modf)
8925c28e8Piotr Jasiukajtis#pragma does_not_read_global_data(ceil, fabs, floor, fmod)
9025c28e8Piotr Jasiukajtis#pragma does_not_write_global_data(acos, asin, atan, atan2)
9125c28e8Piotr Jasiukajtis#pragma does_not_write_global_data(cos, sin, tan, cosh, sinh, tanh)
9225c28e8Piotr Jasiukajtis#pragma does_not_write_global_data(exp, log, log10, pow, sqrt)
9325c28e8Piotr Jasiukajtis#pragma does_not_write_global_data(ldexp)
9425c28e8Piotr Jasiukajtis#pragma does_not_write_global_data(ceil, fabs, floor, fmod)
9525c28e8Piotr Jasiukajtis#pragma no_side_effect(acos, asin, atan, atan2)
9625c28e8Piotr Jasiukajtis#pragma no_side_effect(cos, sin, tan, cosh, sinh, tanh)
9725c28e8Piotr Jasiukajtis#pragma no_side_effect(exp, log, log10, pow, sqrt)
9825c28e8Piotr Jasiukajtis#pragma no_side_effect(ldexp)
9925c28e8Piotr Jasiukajtis#pragma no_side_effect(ceil, fabs, floor, fmod)
10025c28e8Piotr Jasiukajtis#endif
10125c28e8Piotr Jasiukajtis
10225c28e8Piotr Jasiukajtis#if __cplusplus >= 199711L
10325c28e8Piotr Jasiukajtisextern float __acosf(float);
10425c28e8Piotr Jasiukajtisextern float __asinf(float);
10525c28e8Piotr Jasiukajtisextern float __atanf(float);
10625c28e8Piotr Jasiukajtisextern float __atan2f(float, float);
10725c28e8Piotr Jasiukajtisextern float __ceilf(float);
10825c28e8Piotr Jasiukajtisextern float __cosf(float);
10925c28e8Piotr Jasiukajtisextern float __coshf(float);
11025c28e8Piotr Jasiukajtisextern float __expf(float);
11125c28e8Piotr Jasiukajtisextern float __fabsf(float);
11225c28e8Piotr Jasiukajtisextern float __floorf(float);
11325c28e8Piotr Jasiukajtisextern float __fmodf(float, float);
11425c28e8Piotr Jasiukajtisextern float __frexpf(float, int *);
11525c28e8Piotr Jasiukajtisextern float __ldexpf(float, int);
11625c28e8Piotr Jasiukajtisextern float __logf(float);
11725c28e8Piotr Jasiukajtisextern float __log10f(float);
11825c28e8Piotr Jasiukajtisextern float __modff(float, float *);
11925c28e8Piotr Jasiukajtisextern float __powf(float, float);
12025c28e8Piotr Jasiukajtisextern float __sinf(float);
12125c28e8Piotr Jasiukajtisextern float __sinhf(float);
12225c28e8Piotr Jasiukajtisextern float __sqrtf(float);
12325c28e8Piotr Jasiukajtisextern float __tanf(float);
12425c28e8Piotr Jasiukajtisextern float __tanhf(float);
12525c28e8Piotr Jasiukajtis
12625c28e8Piotr Jasiukajtisextern long double __acosl(long double);
12725c28e8Piotr Jasiukajtisextern long double __asinl(long double);
12825c28e8Piotr Jasiukajtisextern long double __atanl(long double);
12925c28e8Piotr Jasiukajtisextern long double __atan2l(long double, long double);
13025c28e8Piotr Jasiukajtisextern long double __ceill(long double);
13125c28e8Piotr Jasiukajtisextern long double __cosl(long double);
13225c28e8Piotr Jasiukajtisextern long double __coshl(long double);
13325c28e8Piotr Jasiukajtisextern long double __expl(long double);
13425c28e8Piotr Jasiukajtisextern long double __fabsl(long double);
13525c28e8Piotr Jasiukajtisextern long double __floorl(long double);
13625c28e8Piotr Jasiukajtisextern long double __fmodl(long double, long double);
13725c28e8Piotr Jasiukajtisextern long double __frexpl(long double, int *);
13825c28e8Piotr Jasiukajtisextern long double __ldexpl(long double, int);
13925c28e8Piotr Jasiukajtisextern long double __logl(long double);
14025c28e8Piotr Jasiukajtisextern long double __log10l(long double);
14125c28e8Piotr Jasiukajtisextern long double __modfl(long double, long double *);
14225c28e8Piotr Jasiukajtisextern long double __powl(long double, long double);
14325c28e8Piotr Jasiukajtisextern long double __sinl(long double);
14425c28e8Piotr Jasiukajtisextern long double __sinhl(long double);
14525c28e8Piotr Jasiukajtisextern long double __sqrtl(long double);
14625c28e8Piotr Jasiukajtisextern long double __tanl(long double);
14725c28e8Piotr Jasiukajtisextern long double __tanhl(long double);
14825c28e8Piotr Jasiukajtis
14925c28e8Piotr Jasiukajtisextern "C++" {
15025c28e8Piotr Jasiukajtis#undef	__X
15125c28e8Piotr Jasiukajtis#undef	__Y
15225c28e8Piotr Jasiukajtis	inline double abs(double __X) { return fabs(__X); }
1539938df9Richard Lowe
1549938df9Richard Lowe	inline double pow(double __X, int __Y) {
1559938df9Richard Lowe		return (pow(__X, (double)(__Y)));
1569938df9Richard Lowe	}
15725c28e8Piotr Jasiukajtis
15825c28e8Piotr Jasiukajtis	inline float abs(float __X) { return __fabsf(__X); }
15925c28e8Piotr Jasiukajtis	inline float acos(float __X) { return __acosf(__X); }
16025c28e8Piotr Jasiukajtis	inline float asin(float __X) { return __asinf(__X); }
16125c28e8Piotr Jasiukajtis	inline float atan(float __X) { return __atanf(__X); }
16225c28e8Piotr Jasiukajtis	inline float atan2(float __X, float __Y) { return __atan2f(__X, __Y); }
16325c28e8Piotr Jasiukajtis	inline float ceil(float __X) { return __ceilf(__X); }
16425c28e8Piotr Jasiukajtis	inline float cos(float __X) { return __cosf(__X); }
16525c28e8Piotr Jasiukajtis	inline float cosh(float __X) { return __coshf(__X); }
16625c28e8Piotr Jasiukajtis	inline float exp(float __X) { return __expf(__X); }
16725c28e8Piotr Jasiukajtis	inline float fabs(float __X) { return __fabsf(__X); }
16825c28e8Piotr Jasiukajtis	inline float floor(float __X) { return __floorf(__X); }
16925c28e8Piotr Jasiukajtis	inline float fmod(float __X, float __Y) { return __fmodf(__X, __Y); }
17025c28e8Piotr Jasiukajtis	inline float frexp(float __X, int *__Y) { return __frexpf(__X, __Y); }
17125c28e8Piotr Jasiukajtis	inline float ldexp(float __X, int __Y) { return __ldexpf(__X, __Y); }
17225c28e8Piotr Jasiukajtis	inline float log(float __X) { return __logf(__X); }
17325c28e8Piotr Jasiukajtis	inline float log10(float __X) { return __log10f(__X); }
17425c28e8Piotr Jasiukajtis	inline float modf(float __X, float *__Y) { return __modff(__X, __Y); }
17525c28e8Piotr Jasiukajtis	inline float pow(float __X, float __Y) { return __powf(__X, __Y); }
1769938df9Richard Lowe
1779938df9Richard Lowe	inline float pow(float __X, int __Y) {
1789938df9Richard Lowe		return (pow((double)(__X), (double)(__Y)));
1799938df9Richard Lowe	}
1809938df9Richard Lowe
18125c28e8Piotr Jasiukajtis	inline float sin(float __X) { return __sinf(__X); }
18225c28e8Piotr Jasiukajtis	inline float sinh(float __X) { return __sinhf(__X); }
18325c28e8Piotr Jasiukajtis	inline float sqrt(float __X) { return __sqrtf(__X); }
18425c28e8Piotr Jasiukajtis	inline float tan(float __X) { return __tanf(__X); }
18525c28e8Piotr Jasiukajtis	inline float tanh(float __X) { return __tanhf(__X); }
18625c28e8Piotr Jasiukajtis
18725c28e8Piotr Jasiukajtis	inline long double abs(long double __X) { return __fabsl(__X); }
18825c28e8Piotr Jasiukajtis	inline long double acos(long double __X) { return __acosl(__X); }
18925c28e8Piotr Jasiukajtis	inline long double asin(long double __X) { return __asinl(__X); }
19025c28e8Piotr Jasiukajtis	inline long double atan(long double __X) { return __atanl(__X); }
1919938df9Richard Lowe
1929938df9Richard Lowe	inline long double atan2(long double __X, long double __Y) {
1939938df9Richard Lowe		return (__atan2l(__X, __Y));
1949938df9Richard Lowe	}
1959938df9Richard Lowe
19625c28e8Piotr Jasiukajtis	inline long double ceil(long double __X) { return __ceill(__X); }
19725c28e8Piotr Jasiukajtis	inline long double cos(long double __X) { return __cosl(__X); }
19825c28e8Piotr Jasiukajtis	inline long double cosh(long double __X) { return __coshl(__X); }
19925c28e8Piotr Jasiukajtis	inline long double exp(long double __X) { return __expl(__X); }
20025c28e8Piotr Jasiukajtis	inline long double fabs(long double __X) { return __fabsl(__X); }
20125c28e8Piotr Jasiukajtis	inline long double floor(long double __X) { return __floorl(__X); }
2029938df9Richard Lowe
2039938df9Richard Lowe	inline long double fmod(long double __X, long double __Y) {
2049938df9Richard Lowe		return (__fmodl(__X, __Y));
2059938df9Richard Lowe	}
2069938df9Richard Lowe
2079938df9Richard Lowe	inline long double frexp(long double __X, int *__Y) {
2089938df9Richard Lowe		return (__frexpl(__X, __Y));
2099938df9Richard Lowe	}
2109938df9Richard Lowe
2119938df9Richard Lowe	inline long double ldexp(long double __X, int __Y) {
2129938df9Richard Lowe		return (__ldexpl(__X, __Y));
2139938df9Richard Lowe	}
2149938df9Richard Lowe
21525c28e8Piotr Jasiukajtis	inline long double log(long double __X) { return __logl(__X); }
21625c28e8Piotr Jasiukajtis	inline long double log10(long double __X) { return __log10l(__X); }
2179938df9Richard Lowe
2189938df9Richard Lowe	inline long double modf(long double __X, long double *__Y) {
2199938df9Richard Lowe		return (__modfl(__X, __Y));
2209938df9Richard Lowe	}
2219938df9Richard Lowe
2229938df9Richard Lowe	inline long double pow(long double __X, long double __Y) {
2239938df9Richard Lowe		return (__powl(__X, __Y));
2249938df9Richard Lowe	}
2259938df9Richard Lowe
2269938df9Richard Lowe	inline long double pow(long double __X, int __Y) {
2279938df9Richard Lowe		return (__powl(__X, (long double) (__Y)));
2289938df9Richard Lowe	}
2299938df9Richard Lowe
23025c28e8Piotr Jasiukajtis	inline long double sin(long double __X) { return __sinl(__X); }
23125c28e8Piotr Jasiukajtis	inline long double sinh(long double __X) { return __sinhl(__X); }
23225c28e8Piotr Jasiukajtis	inline long double sqrt(long double __X) { return __sqrtl(__X); }
23325c28e8Piotr Jasiukajtis	inline long double tan(long double __X) { return __tanl(__X); }
23425c28e8Piotr Jasiukajtis	inline long double tanh(long double __X) { return __tanhl(__X); }
23525c28e8Piotr Jasiukajtis}	/* end of extern "C++" */
23625c28e8Piotr Jasiukajtis#endif	/* __cplusplus >= 199711L */
23725c28e8Piotr Jasiukajtis
23825c28e8Piotr Jasiukajtis#if __cplusplus >= 199711L
23925c28e8Piotr Jasiukajtis}	/* end of namespace std */
24025c28e8Piotr Jasiukajtis#endif
24125c28e8Piotr Jasiukajtis
24225c28e8Piotr Jasiukajtis#ifdef __cplusplus
24325c28e8Piotr Jasiukajtis}
24425c28e8Piotr Jasiukajtis#endif
24525c28e8Piotr Jasiukajtis
24625c28e8Piotr Jasiukajtis#endif	/* _ISO_MATH_ISO_H */
247