1*906afcb8SAndy Fiddaman 2*906afcb8SAndy Fiddaman/* : : generated by proto : : */ 3*906afcb8SAndy Fiddaman/* : : generated from contrib/ast/src/cmd/ksh93/features/math.sh by iffe version 2012-07-17 : : */ 4*906afcb8SAndy Fiddaman#ifndef _def_math_ksh93 5*906afcb8SAndy Fiddaman#if !defined(__PROTO__) 6*906afcb8SAndy Fiddaman# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) 7*906afcb8SAndy Fiddaman# if defined(__cplusplus) 8*906afcb8SAndy Fiddaman# define __LINKAGE__ "C" 9*906afcb8SAndy Fiddaman# else 10*906afcb8SAndy Fiddaman# define __LINKAGE__ 11*906afcb8SAndy Fiddaman# endif 12*906afcb8SAndy Fiddaman# define __STDARG__ 13*906afcb8SAndy Fiddaman# define __PROTO__(x) x 14*906afcb8SAndy Fiddaman# define __OTORP__(x) 15*906afcb8SAndy Fiddaman# define __PARAM__(n,o) n 16*906afcb8SAndy Fiddaman# if !defined(__STDC__) && !defined(__cplusplus) 17*906afcb8SAndy Fiddaman# if !defined(c_plusplus) 18*906afcb8SAndy Fiddaman# define const 19*906afcb8SAndy Fiddaman# endif 20*906afcb8SAndy Fiddaman# define signed 21*906afcb8SAndy Fiddaman# define void int 22*906afcb8SAndy Fiddaman# define volatile 23*906afcb8SAndy Fiddaman# define __V_ char 24*906afcb8SAndy Fiddaman# else 25*906afcb8SAndy Fiddaman# define __V_ void 26*906afcb8SAndy Fiddaman# endif 27*906afcb8SAndy Fiddaman# else 28*906afcb8SAndy Fiddaman# define __PROTO__(x) () 29*906afcb8SAndy Fiddaman# define __OTORP__(x) x 30*906afcb8SAndy Fiddaman# define __PARAM__(n,o) o 31*906afcb8SAndy Fiddaman# define __LINKAGE__ 32*906afcb8SAndy Fiddaman# define __V_ char 33*906afcb8SAndy Fiddaman# define const 34*906afcb8SAndy Fiddaman# define signed 35*906afcb8SAndy Fiddaman# define void int 36*906afcb8SAndy Fiddaman# define volatile 37*906afcb8SAndy Fiddaman# endif 38*906afcb8SAndy Fiddaman# define __MANGLE__ __LINKAGE__ 39*906afcb8SAndy Fiddaman# if defined(__cplusplus) || defined(c_plusplus) 40*906afcb8SAndy Fiddaman# define __VARARG__ ... 41*906afcb8SAndy Fiddaman# else 42*906afcb8SAndy Fiddaman# define __VARARG__ 43*906afcb8SAndy Fiddaman# endif 44*906afcb8SAndy Fiddaman# if defined(__STDARG__) 45*906afcb8SAndy Fiddaman# define __VA_START__(p,a) va_start(p,a) 46*906afcb8SAndy Fiddaman# else 47*906afcb8SAndy Fiddaman# define __VA_START__(p,a) va_start(p) 48*906afcb8SAndy Fiddaman# endif 49*906afcb8SAndy Fiddaman# if !defined(__INLINE__) 50*906afcb8SAndy Fiddaman# if defined(__cplusplus) 51*906afcb8SAndy Fiddaman# define __INLINE__ extern __MANGLE__ inline 52*906afcb8SAndy Fiddaman# else 53*906afcb8SAndy Fiddaman# if defined(_WIN32) && !defined(__GNUC__) 54*906afcb8SAndy Fiddaman# define __INLINE__ __inline 55*906afcb8SAndy Fiddaman# endif 56*906afcb8SAndy Fiddaman# endif 57*906afcb8SAndy Fiddaman# endif 58*906afcb8SAndy Fiddaman#endif 59*906afcb8SAndy Fiddaman#if !defined(__LINKAGE__) 60*906afcb8SAndy Fiddaman#define __LINKAGE__ /* 2004-08-11 transition */ 61*906afcb8SAndy Fiddaman#endif 62*906afcb8SAndy Fiddaman 63*906afcb8SAndy Fiddaman#define _def_math_ksh93 1 64*906afcb8SAndy Fiddaman#define _sys_types 1 /* #include <sys/types.h> ok */ 65*906afcb8SAndy Fiddaman 66*906afcb8SAndy Fiddaman 67*906afcb8SAndy Fiddaman/* : : generated by cmd/ast/tools/iffe from contrib/ast/src/cmd/ksh93/data/math.tab : : */ 68*906afcb8SAndy Fiddaman 69*906afcb8SAndy Fiddamantypedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...)); 70*906afcb8SAndy Fiddaman 71*906afcb8SAndy Fiddaman#include <math.h> 72*906afcb8SAndy Fiddaman#include <ieeefp.h> 73*906afcb8SAndy Fiddaman 74*906afcb8SAndy Fiddamanstatic Sfdouble_t local_finite __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return finite(a1);} 75*906afcb8SAndy Fiddamanstatic int local_fpclassify __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return fpclassify(a1);} 76*906afcb8SAndy Fiddamanstatic int local_fpclass __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return fpclass(a1);} 77*906afcb8SAndy Fiddamanstatic int local_isfinite __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return isfinite(a1);} 78*906afcb8SAndy Fiddamanstatic int local_isgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isgreater(a1,a2);} 79*906afcb8SAndy Fiddamanstatic int local_isgreaterequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isgreaterequal(a1,a2);} 80*906afcb8SAndy Fiddamanstatic int local_isinf __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return isinf(a1);} 81*906afcb8SAndy Fiddamanstatic int local_isless __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isless(a1,a2);} 82*906afcb8SAndy Fiddamanstatic int local_islessequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessequal(a1,a2);} 83*906afcb8SAndy Fiddamanstatic int local_islessgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessgreater(a1,a2);} 84*906afcb8SAndy Fiddamanstatic int local_isnormal __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return isnormal(a1);} 85*906afcb8SAndy Fiddamanstatic int local_issubnormal __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){ int q = fpclassify(a1); return q == FP_SUBNORMAL; } 86*906afcb8SAndy Fiddamanstatic int local_isunordered __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isunordered(a1,a2);} 87*906afcb8SAndy Fiddamanstatic int local_iszero __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){ int q = fpclassify(a1); return q == FP_ZERO; } 88*906afcb8SAndy Fiddamanstatic int local_signbit __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return signbit(a1);} 89*906afcb8SAndy Fiddaman 90*906afcb8SAndy Fiddaman/* 91*906afcb8SAndy Fiddaman * first byte is two-digit octal number. Last digit is number of args 92*906afcb8SAndy Fiddaman * first digit is 0 if return value is double, 1 for integer 93*906afcb8SAndy Fiddaman */ 94*906afcb8SAndy Fiddamanconst struct mathtab shtab_math[] = 95*906afcb8SAndy Fiddaman{ 96*906afcb8SAndy Fiddaman "\001acos", (Math_f)(uintptr_t)acosl, 97*906afcb8SAndy Fiddaman "\001acosh", (Math_f)(uintptr_t)acoshl, 98*906afcb8SAndy Fiddaman "\001asin", (Math_f)(uintptr_t)asinl, 99*906afcb8SAndy Fiddaman "\001asinh", (Math_f)(uintptr_t)asinhl, 100*906afcb8SAndy Fiddaman "\001atan", (Math_f)(uintptr_t)atanl, 101*906afcb8SAndy Fiddaman "\002atan2", (Math_f)(uintptr_t)atan2l, 102*906afcb8SAndy Fiddaman "\001atanh", (Math_f)(uintptr_t)atanhl, 103*906afcb8SAndy Fiddaman "\001cbrt", (Math_f)(uintptr_t)cbrtl, 104*906afcb8SAndy Fiddaman "\001ceil", (Math_f)(uintptr_t)ceill, 105*906afcb8SAndy Fiddaman "\002copysign", (Math_f)(uintptr_t)copysignl, 106*906afcb8SAndy Fiddaman "\001cos", (Math_f)(uintptr_t)cosl, 107*906afcb8SAndy Fiddaman "\001cosh", (Math_f)(uintptr_t)coshl, 108*906afcb8SAndy Fiddaman "\001erf", (Math_f)(uintptr_t)erfl, 109*906afcb8SAndy Fiddaman "\001erfc", (Math_f)(uintptr_t)erfcl, 110*906afcb8SAndy Fiddaman "\001exp", (Math_f)(uintptr_t)expl, 111*906afcb8SAndy Fiddaman "\001exp2", (Math_f)(uintptr_t)exp2l, 112*906afcb8SAndy Fiddaman "\001expm1", (Math_f)(uintptr_t)expm1l, 113*906afcb8SAndy Fiddaman "\001fabs", (Math_f)(uintptr_t)fabsl, 114*906afcb8SAndy Fiddaman "\001abs", (Math_f)(uintptr_t)fabsl, 115*906afcb8SAndy Fiddaman "\002fdim", (Math_f)(uintptr_t)fdiml, 116*906afcb8SAndy Fiddaman "\001finite", (Math_f)(uintptr_t)local_finite, 117*906afcb8SAndy Fiddaman "\001floor", (Math_f)(uintptr_t)floorl, 118*906afcb8SAndy Fiddaman "\001int", (Math_f)(uintptr_t)floorl, 119*906afcb8SAndy Fiddaman "\003fma", (Math_f)(uintptr_t)fmal, 120*906afcb8SAndy Fiddaman "\002fmax", (Math_f)(uintptr_t)fmaxl, 121*906afcb8SAndy Fiddaman "\002fmin", (Math_f)(uintptr_t)fminl, 122*906afcb8SAndy Fiddaman "\002fmod", (Math_f)(uintptr_t)fmodl, 123*906afcb8SAndy Fiddaman "\011fpclassify", (Math_f)(uintptr_t)local_fpclassify, 124*906afcb8SAndy Fiddaman "\011fpclass", (Math_f)(uintptr_t)local_fpclass, 125*906afcb8SAndy Fiddaman "\002hypot", (Math_f)(uintptr_t)hypotl, 126*906afcb8SAndy Fiddaman "\011ilogb", (Math_f)(uintptr_t)ilogbl, 127*906afcb8SAndy Fiddaman "\011isfinite", (Math_f)(uintptr_t)local_isfinite, 128*906afcb8SAndy Fiddaman "\012isgreater", (Math_f)(uintptr_t)local_isgreater, 129*906afcb8SAndy Fiddaman "\012isgreaterequal", (Math_f)(uintptr_t)local_isgreaterequal, 130*906afcb8SAndy Fiddaman "\011isinf", (Math_f)(uintptr_t)local_isinf, 131*906afcb8SAndy Fiddaman "\012isless", (Math_f)(uintptr_t)local_isless, 132*906afcb8SAndy Fiddaman "\012islessequal", (Math_f)(uintptr_t)local_islessequal, 133*906afcb8SAndy Fiddaman "\012islessgreater", (Math_f)(uintptr_t)local_islessgreater, 134*906afcb8SAndy Fiddaman "\011isnan", (Math_f)(uintptr_t)isnanl, 135*906afcb8SAndy Fiddaman "\011isnormal", (Math_f)(uintptr_t)local_isnormal, 136*906afcb8SAndy Fiddaman "\011issubnormal", (Math_f)(uintptr_t)local_issubnormal, 137*906afcb8SAndy Fiddaman "\012isunordered", (Math_f)(uintptr_t)local_isunordered, 138*906afcb8SAndy Fiddaman "\011iszero", (Math_f)(uintptr_t)local_iszero, 139*906afcb8SAndy Fiddaman "\001j0", (Math_f)(uintptr_t)j0l, 140*906afcb8SAndy Fiddaman "\001j1", (Math_f)(uintptr_t)j1l, 141*906afcb8SAndy Fiddaman "\002jn", (Math_f)(uintptr_t)jnl, 142*906afcb8SAndy Fiddaman "\042ldexp", (Math_f)(uintptr_t)ldexpl, 143*906afcb8SAndy Fiddaman "\001lgamma", (Math_f)(uintptr_t)lgammal, 144*906afcb8SAndy Fiddaman "\001log", (Math_f)(uintptr_t)logl, 145*906afcb8SAndy Fiddaman "\001log10", (Math_f)(uintptr_t)log10l, 146*906afcb8SAndy Fiddaman "\001log1p", (Math_f)(uintptr_t)log1pl, 147*906afcb8SAndy Fiddaman "\001log2", (Math_f)(uintptr_t)log2l, 148*906afcb8SAndy Fiddaman "\001logb", (Math_f)(uintptr_t)logbl, 149*906afcb8SAndy Fiddaman "\001nearbyint", (Math_f)(uintptr_t)nearbyintl, 150*906afcb8SAndy Fiddaman "\002nextafter", (Math_f)(uintptr_t)nextafterl, 151*906afcb8SAndy Fiddaman "\002nexttoward", (Math_f)(uintptr_t)nexttowardl, 152*906afcb8SAndy Fiddaman "\002pow", (Math_f)(uintptr_t)powl, 153*906afcb8SAndy Fiddaman "\002remainder", (Math_f)(uintptr_t)remainderl, 154*906afcb8SAndy Fiddaman "\001rint", (Math_f)(uintptr_t)rintl, 155*906afcb8SAndy Fiddaman "\001round", (Math_f)(uintptr_t)roundl, 156*906afcb8SAndy Fiddaman "\002scalb", (Math_f)(uintptr_t)scalbl, 157*906afcb8SAndy Fiddaman "\002scalbn", (Math_f)(uintptr_t)scalbnl, 158*906afcb8SAndy Fiddaman "\011signbit", (Math_f)(uintptr_t)local_signbit, 159*906afcb8SAndy Fiddaman "\001sin", (Math_f)(uintptr_t)sinl, 160*906afcb8SAndy Fiddaman "\001sinh", (Math_f)(uintptr_t)sinhl, 161*906afcb8SAndy Fiddaman "\001sqrt", (Math_f)(uintptr_t)sqrtl, 162*906afcb8SAndy Fiddaman "\001tan", (Math_f)(uintptr_t)tanl, 163*906afcb8SAndy Fiddaman "\001tanh", (Math_f)(uintptr_t)tanhl, 164*906afcb8SAndy Fiddaman "\001tgamma", (Math_f)(uintptr_t)tgammal, 165*906afcb8SAndy Fiddaman "\001trunc", (Math_f)(uintptr_t)truncl, 166*906afcb8SAndy Fiddaman "\001y0", (Math_f)(uintptr_t)y0l, 167*906afcb8SAndy Fiddaman "\001y1", (Math_f)(uintptr_t)y1l, 168*906afcb8SAndy Fiddaman "\002yn", (Math_f)(uintptr_t)ynl, 169*906afcb8SAndy Fiddaman "", (Math_f)0 170*906afcb8SAndy Fiddaman}; 171*906afcb8SAndy Fiddaman#endif 172