125c28e83SPiotr Jasiukajtis /* 225c28e83SPiotr Jasiukajtis * CDDL HEADER START 325c28e83SPiotr Jasiukajtis * 425c28e83SPiotr Jasiukajtis * The contents of this file are subject to the terms of the 525c28e83SPiotr Jasiukajtis * Common Development and Distribution License (the "License"). 625c28e83SPiotr Jasiukajtis * You may not use this file except in compliance with the License. 725c28e83SPiotr Jasiukajtis * 825c28e83SPiotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 925c28e83SPiotr Jasiukajtis * or http://www.opensolaris.org/os/licensing. 1025c28e83SPiotr Jasiukajtis * See the License for the specific language governing permissions 1125c28e83SPiotr Jasiukajtis * and limitations under the License. 1225c28e83SPiotr Jasiukajtis * 1325c28e83SPiotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each 1425c28e83SPiotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1525c28e83SPiotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the 1625c28e83SPiotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying 1725c28e83SPiotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner] 1825c28e83SPiotr Jasiukajtis * 1925c28e83SPiotr Jasiukajtis * CDDL HEADER END 2025c28e83SPiotr Jasiukajtis */ 2125c28e83SPiotr Jasiukajtis /* 2225c28e83SPiotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc. All rights reserved. 2325c28e83SPiotr Jasiukajtis */ 2425c28e83SPiotr Jasiukajtis /* 2525c28e83SPiotr Jasiukajtis * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 2625c28e83SPiotr Jasiukajtis * Use is subject to license terms. 2725c28e83SPiotr Jasiukajtis */ 2825c28e83SPiotr Jasiukajtis 2925c28e83SPiotr Jasiukajtis #ifndef _ISO_MATH_ISO_H 3025c28e83SPiotr Jasiukajtis #define _ISO_MATH_ISO_H 3125c28e83SPiotr Jasiukajtis 3225c28e83SPiotr Jasiukajtis #include <sys/feature_tests.h> 3325c28e83SPiotr Jasiukajtis 3425c28e83SPiotr Jasiukajtis #ifdef __cplusplus 3525c28e83SPiotr Jasiukajtis extern "C" { 3625c28e83SPiotr Jasiukajtis #endif 3725c28e83SPiotr Jasiukajtis 3825c28e83SPiotr Jasiukajtis #if !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && !defined(__C99FEATURES__) 3925c28e83SPiotr Jasiukajtis typedef union _h_val { 4025c28e83SPiotr Jasiukajtis unsigned long _i[sizeof (double) / sizeof (unsigned long)]; 4125c28e83SPiotr Jasiukajtis double _d; 4225c28e83SPiotr Jasiukajtis } _h_val; 4325c28e83SPiotr Jasiukajtis 4425c28e83SPiotr Jasiukajtis #ifdef __STDC__ 4525c28e83SPiotr Jasiukajtis extern const _h_val __huge_val; 4625c28e83SPiotr Jasiukajtis #else 4725c28e83SPiotr Jasiukajtis extern _h_val __huge_val; 4825c28e83SPiotr Jasiukajtis #endif 4925c28e83SPiotr Jasiukajtis #undef HUGE_VAL 5025c28e83SPiotr Jasiukajtis #define HUGE_VAL __huge_val._d 5125c28e83SPiotr Jasiukajtis #endif /* !defined(_STDC_C99) && _XOPEN_SOURCE - 0 < 600 && ... */ 5225c28e83SPiotr Jasiukajtis 5325c28e83SPiotr Jasiukajtis #if __cplusplus >= 199711L 5425c28e83SPiotr Jasiukajtis namespace std { 5525c28e83SPiotr Jasiukajtis #endif 5625c28e83SPiotr Jasiukajtis 57*9938df9eSRichard Lowe extern double acos(double); 58*9938df9eSRichard Lowe extern double asin(double); 59*9938df9eSRichard Lowe extern double atan(double); 60*9938df9eSRichard Lowe extern double atan2(double, double); 61*9938df9eSRichard Lowe extern double cos(double); 62*9938df9eSRichard Lowe extern double sin(double); 63*9938df9eSRichard Lowe extern double tan(double); 6425c28e83SPiotr Jasiukajtis 65*9938df9eSRichard Lowe extern double cosh(double); 66*9938df9eSRichard Lowe extern double sinh(double); 67*9938df9eSRichard Lowe extern double tanh(double); 6825c28e83SPiotr Jasiukajtis 69*9938df9eSRichard Lowe extern double exp(double); 70*9938df9eSRichard Lowe extern double frexp(double, int *); 71*9938df9eSRichard Lowe extern double ldexp(double, int); 72*9938df9eSRichard Lowe extern double log(double); 73*9938df9eSRichard Lowe extern double log10(double); 74*9938df9eSRichard Lowe extern double modf(double, double *); 7525c28e83SPiotr Jasiukajtis 76*9938df9eSRichard Lowe extern double pow(double, double); 77*9938df9eSRichard Lowe extern double sqrt(double); 7825c28e83SPiotr Jasiukajtis 79*9938df9eSRichard Lowe extern double ceil(double); 80*9938df9eSRichard Lowe extern double fabs(double); 81*9938df9eSRichard Lowe extern double floor(double); 82*9938df9eSRichard Lowe extern double fmod(double, double); 8325c28e83SPiotr Jasiukajtis 8425c28e83SPiotr Jasiukajtis #if defined(__MATHERR_ERRNO_DONTCARE) 8525c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(acos, asin, atan, atan2) 8625c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(cos, sin, tan, cosh, sinh, tanh) 8725c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(exp, log, log10, pow, sqrt) 8825c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(frexp, ldexp, modf) 8925c28e83SPiotr Jasiukajtis #pragma does_not_read_global_data(ceil, fabs, floor, fmod) 9025c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(acos, asin, atan, atan2) 9125c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(cos, sin, tan, cosh, sinh, tanh) 9225c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(exp, log, log10, pow, sqrt) 9325c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ldexp) 9425c28e83SPiotr Jasiukajtis #pragma does_not_write_global_data(ceil, fabs, floor, fmod) 9525c28e83SPiotr Jasiukajtis #pragma no_side_effect(acos, asin, atan, atan2) 9625c28e83SPiotr Jasiukajtis #pragma no_side_effect(cos, sin, tan, cosh, sinh, tanh) 9725c28e83SPiotr Jasiukajtis #pragma no_side_effect(exp, log, log10, pow, sqrt) 9825c28e83SPiotr Jasiukajtis #pragma no_side_effect(ldexp) 9925c28e83SPiotr Jasiukajtis #pragma no_side_effect(ceil, fabs, floor, fmod) 10025c28e83SPiotr Jasiukajtis #endif 10125c28e83SPiotr Jasiukajtis 10225c28e83SPiotr Jasiukajtis #if __cplusplus >= 199711L 10325c28e83SPiotr Jasiukajtis extern float __acosf(float); 10425c28e83SPiotr Jasiukajtis extern float __asinf(float); 10525c28e83SPiotr Jasiukajtis extern float __atanf(float); 10625c28e83SPiotr Jasiukajtis extern float __atan2f(float, float); 10725c28e83SPiotr Jasiukajtis extern float __ceilf(float); 10825c28e83SPiotr Jasiukajtis extern float __cosf(float); 10925c28e83SPiotr Jasiukajtis extern float __coshf(float); 11025c28e83SPiotr Jasiukajtis extern float __expf(float); 11125c28e83SPiotr Jasiukajtis extern float __fabsf(float); 11225c28e83SPiotr Jasiukajtis extern float __floorf(float); 11325c28e83SPiotr Jasiukajtis extern float __fmodf(float, float); 11425c28e83SPiotr Jasiukajtis extern float __frexpf(float, int *); 11525c28e83SPiotr Jasiukajtis extern float __ldexpf(float, int); 11625c28e83SPiotr Jasiukajtis extern float __logf(float); 11725c28e83SPiotr Jasiukajtis extern float __log10f(float); 11825c28e83SPiotr Jasiukajtis extern float __modff(float, float *); 11925c28e83SPiotr Jasiukajtis extern float __powf(float, float); 12025c28e83SPiotr Jasiukajtis extern float __sinf(float); 12125c28e83SPiotr Jasiukajtis extern float __sinhf(float); 12225c28e83SPiotr Jasiukajtis extern float __sqrtf(float); 12325c28e83SPiotr Jasiukajtis extern float __tanf(float); 12425c28e83SPiotr Jasiukajtis extern float __tanhf(float); 12525c28e83SPiotr Jasiukajtis 12625c28e83SPiotr Jasiukajtis extern long double __acosl(long double); 12725c28e83SPiotr Jasiukajtis extern long double __asinl(long double); 12825c28e83SPiotr Jasiukajtis extern long double __atanl(long double); 12925c28e83SPiotr Jasiukajtis extern long double __atan2l(long double, long double); 13025c28e83SPiotr Jasiukajtis extern long double __ceill(long double); 13125c28e83SPiotr Jasiukajtis extern long double __cosl(long double); 13225c28e83SPiotr Jasiukajtis extern long double __coshl(long double); 13325c28e83SPiotr Jasiukajtis extern long double __expl(long double); 13425c28e83SPiotr Jasiukajtis extern long double __fabsl(long double); 13525c28e83SPiotr Jasiukajtis extern long double __floorl(long double); 13625c28e83SPiotr Jasiukajtis extern long double __fmodl(long double, long double); 13725c28e83SPiotr Jasiukajtis extern long double __frexpl(long double, int *); 13825c28e83SPiotr Jasiukajtis extern long double __ldexpl(long double, int); 13925c28e83SPiotr Jasiukajtis extern long double __logl(long double); 14025c28e83SPiotr Jasiukajtis extern long double __log10l(long double); 14125c28e83SPiotr Jasiukajtis extern long double __modfl(long double, long double *); 14225c28e83SPiotr Jasiukajtis extern long double __powl(long double, long double); 14325c28e83SPiotr Jasiukajtis extern long double __sinl(long double); 14425c28e83SPiotr Jasiukajtis extern long double __sinhl(long double); 14525c28e83SPiotr Jasiukajtis extern long double __sqrtl(long double); 14625c28e83SPiotr Jasiukajtis extern long double __tanl(long double); 14725c28e83SPiotr Jasiukajtis extern long double __tanhl(long double); 14825c28e83SPiotr Jasiukajtis 14925c28e83SPiotr Jasiukajtis extern "C++" { 15025c28e83SPiotr Jasiukajtis #undef __X 15125c28e83SPiotr Jasiukajtis #undef __Y abs(double __X)15225c28e83SPiotr Jasiukajtis inline double abs(double __X) { return fabs(__X); } 153*9938df9eSRichard Lowe pow(double __X,int __Y)154*9938df9eSRichard Lowe inline double pow(double __X, int __Y) { 155*9938df9eSRichard Lowe return (pow(__X, (double)(__Y))); 156*9938df9eSRichard Lowe } 15725c28e83SPiotr Jasiukajtis abs(float __X)15825c28e83SPiotr Jasiukajtis inline float abs(float __X) { return __fabsf(__X); } acos(float __X)15925c28e83SPiotr Jasiukajtis inline float acos(float __X) { return __acosf(__X); } asin(float __X)16025c28e83SPiotr Jasiukajtis inline float asin(float __X) { return __asinf(__X); } atan(float __X)16125c28e83SPiotr Jasiukajtis inline float atan(float __X) { return __atanf(__X); } atan2(float __X,float __Y)16225c28e83SPiotr Jasiukajtis inline float atan2(float __X, float __Y) { return __atan2f(__X, __Y); } ceil(float __X)16325c28e83SPiotr Jasiukajtis inline float ceil(float __X) { return __ceilf(__X); } cos(float __X)16425c28e83SPiotr Jasiukajtis inline float cos(float __X) { return __cosf(__X); } cosh(float __X)16525c28e83SPiotr Jasiukajtis inline float cosh(float __X) { return __coshf(__X); } exp(float __X)16625c28e83SPiotr Jasiukajtis inline float exp(float __X) { return __expf(__X); } fabs(float __X)16725c28e83SPiotr Jasiukajtis inline float fabs(float __X) { return __fabsf(__X); } floor(float __X)16825c28e83SPiotr Jasiukajtis inline float floor(float __X) { return __floorf(__X); } fmod(float __X,float __Y)16925c28e83SPiotr Jasiukajtis inline float fmod(float __X, float __Y) { return __fmodf(__X, __Y); } frexp(float __X,int * __Y)17025c28e83SPiotr Jasiukajtis inline float frexp(float __X, int *__Y) { return __frexpf(__X, __Y); } ldexp(float __X,int __Y)17125c28e83SPiotr Jasiukajtis inline float ldexp(float __X, int __Y) { return __ldexpf(__X, __Y); } log(float __X)17225c28e83SPiotr Jasiukajtis inline float log(float __X) { return __logf(__X); } log10(float __X)17325c28e83SPiotr Jasiukajtis inline float log10(float __X) { return __log10f(__X); } modf(float __X,float * __Y)17425c28e83SPiotr Jasiukajtis inline float modf(float __X, float *__Y) { return __modff(__X, __Y); } pow(float __X,float __Y)17525c28e83SPiotr Jasiukajtis inline float pow(float __X, float __Y) { return __powf(__X, __Y); } 176*9938df9eSRichard Lowe pow(float __X,int __Y)177*9938df9eSRichard Lowe inline float pow(float __X, int __Y) { 178*9938df9eSRichard Lowe return (pow((double)(__X), (double)(__Y))); 179*9938df9eSRichard Lowe } 180*9938df9eSRichard Lowe sin(float __X)18125c28e83SPiotr Jasiukajtis inline float sin(float __X) { return __sinf(__X); } sinh(float __X)18225c28e83SPiotr Jasiukajtis inline float sinh(float __X) { return __sinhf(__X); } sqrt(float __X)18325c28e83SPiotr Jasiukajtis inline float sqrt(float __X) { return __sqrtf(__X); } tan(float __X)18425c28e83SPiotr Jasiukajtis inline float tan(float __X) { return __tanf(__X); } tanh(float __X)18525c28e83SPiotr Jasiukajtis inline float tanh(float __X) { return __tanhf(__X); } 18625c28e83SPiotr Jasiukajtis abs(long double __X)18725c28e83SPiotr Jasiukajtis inline long double abs(long double __X) { return __fabsl(__X); } acos(long double __X)18825c28e83SPiotr Jasiukajtis inline long double acos(long double __X) { return __acosl(__X); } asin(long double __X)18925c28e83SPiotr Jasiukajtis inline long double asin(long double __X) { return __asinl(__X); } atan(long double __X)19025c28e83SPiotr Jasiukajtis inline long double atan(long double __X) { return __atanl(__X); } 191*9938df9eSRichard Lowe atan2(long double __X,long double __Y)192*9938df9eSRichard Lowe inline long double atan2(long double __X, long double __Y) { 193*9938df9eSRichard Lowe return (__atan2l(__X, __Y)); 194*9938df9eSRichard Lowe } 195*9938df9eSRichard Lowe ceil(long double __X)19625c28e83SPiotr Jasiukajtis inline long double ceil(long double __X) { return __ceill(__X); } cos(long double __X)19725c28e83SPiotr Jasiukajtis inline long double cos(long double __X) { return __cosl(__X); } cosh(long double __X)19825c28e83SPiotr Jasiukajtis inline long double cosh(long double __X) { return __coshl(__X); } exp(long double __X)19925c28e83SPiotr Jasiukajtis inline long double exp(long double __X) { return __expl(__X); } fabs(long double __X)20025c28e83SPiotr Jasiukajtis inline long double fabs(long double __X) { return __fabsl(__X); } floor(long double __X)20125c28e83SPiotr Jasiukajtis inline long double floor(long double __X) { return __floorl(__X); } 202*9938df9eSRichard Lowe fmod(long double __X,long double __Y)203*9938df9eSRichard Lowe inline long double fmod(long double __X, long double __Y) { 204*9938df9eSRichard Lowe return (__fmodl(__X, __Y)); 205*9938df9eSRichard Lowe } 206*9938df9eSRichard Lowe frexp(long double __X,int * __Y)207*9938df9eSRichard Lowe inline long double frexp(long double __X, int *__Y) { 208*9938df9eSRichard Lowe return (__frexpl(__X, __Y)); 209*9938df9eSRichard Lowe } 210*9938df9eSRichard Lowe ldexp(long double __X,int __Y)211*9938df9eSRichard Lowe inline long double ldexp(long double __X, int __Y) { 212*9938df9eSRichard Lowe return (__ldexpl(__X, __Y)); 213*9938df9eSRichard Lowe } 214*9938df9eSRichard Lowe log(long double __X)21525c28e83SPiotr Jasiukajtis inline long double log(long double __X) { return __logl(__X); } log10(long double __X)21625c28e83SPiotr Jasiukajtis inline long double log10(long double __X) { return __log10l(__X); } 217*9938df9eSRichard Lowe modf(long double __X,long double * __Y)218*9938df9eSRichard Lowe inline long double modf(long double __X, long double *__Y) { 219*9938df9eSRichard Lowe return (__modfl(__X, __Y)); 220*9938df9eSRichard Lowe } 221*9938df9eSRichard Lowe pow(long double __X,long double __Y)222*9938df9eSRichard Lowe inline long double pow(long double __X, long double __Y) { 223*9938df9eSRichard Lowe return (__powl(__X, __Y)); 224*9938df9eSRichard Lowe } 225*9938df9eSRichard Lowe pow(long double __X,int __Y)226*9938df9eSRichard Lowe inline long double pow(long double __X, int __Y) { 227*9938df9eSRichard Lowe return (__powl(__X, (long double) (__Y))); 228*9938df9eSRichard Lowe } 229*9938df9eSRichard Lowe sin(long double __X)23025c28e83SPiotr Jasiukajtis inline long double sin(long double __X) { return __sinl(__X); } sinh(long double __X)23125c28e83SPiotr Jasiukajtis inline long double sinh(long double __X) { return __sinhl(__X); } sqrt(long double __X)23225c28e83SPiotr Jasiukajtis inline long double sqrt(long double __X) { return __sqrtl(__X); } tan(long double __X)23325c28e83SPiotr Jasiukajtis inline long double tan(long double __X) { return __tanl(__X); } tanh(long double __X)23425c28e83SPiotr Jasiukajtis inline long double tanh(long double __X) { return __tanhl(__X); } 23525c28e83SPiotr Jasiukajtis } /* end of extern "C++" */ 23625c28e83SPiotr Jasiukajtis #endif /* __cplusplus >= 199711L */ 23725c28e83SPiotr Jasiukajtis 23825c28e83SPiotr Jasiukajtis #if __cplusplus >= 199711L 23925c28e83SPiotr Jasiukajtis } /* end of namespace std */ 24025c28e83SPiotr Jasiukajtis #endif 24125c28e83SPiotr Jasiukajtis 24225c28e83SPiotr Jasiukajtis #ifdef __cplusplus 24325c28e83SPiotr Jasiukajtis } 24425c28e83SPiotr Jasiukajtis #endif 24525c28e83SPiotr Jasiukajtis 24625c28e83SPiotr Jasiukajtis #endif /* _ISO_MATH_ISO_H */ 247