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