summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ast/libshell/i386/FEATURE/math
blob: b86d8d56ac40d3ed86b2bb740f55d27598d39a8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

/* : : generated by proto : : */
/* : : generated from contrib/ast/src/cmd/ksh93/features/math.sh by iffe version 2012-07-17 : : */
#ifndef _def_math_ksh93
#if !defined(__PROTO__)
#  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#    if defined(__cplusplus)
#      define __LINKAGE__	"C"
#    else
#      define __LINKAGE__
#    endif
#    define __STDARG__
#    define __PROTO__(x)	x
#    define __OTORP__(x)
#    define __PARAM__(n,o)	n
#    if !defined(__STDC__) && !defined(__cplusplus)
#      if !defined(c_plusplus)
#      	define const
#      endif
#      define signed
#      define void		int
#      define volatile
#      define __V_		char
#    else
#      define __V_		void
#    endif
#  else
#    define __PROTO__(x)	()
#    define __OTORP__(x)	x
#    define __PARAM__(n,o)	o
#    define __LINKAGE__
#    define __V_		char
#    define const
#    define signed
#    define void		int
#    define volatile
#  endif
#  define __MANGLE__	__LINKAGE__
#  if defined(__cplusplus) || defined(c_plusplus)
#    define __VARARG__	...
#  else
#    define __VARARG__
#  endif
#  if defined(__STDARG__)
#    define __VA_START__(p,a)	va_start(p,a)
#  else
#    define __VA_START__(p,a)	va_start(p)
#  endif
#  if !defined(__INLINE__)
#    if defined(__cplusplus)
#      define __INLINE__	extern __MANGLE__ inline
#    else
#      if defined(_WIN32) && !defined(__GNUC__)
#      	define __INLINE__	__inline
#      endif
#    endif
#  endif
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__		/* 2004-08-11 transition */
#endif

#define _def_math_ksh93	1
#define _sys_types	1	/* #include <sys/types.h> ok */


/* : : generated by cmd/ast/tools/iffe from contrib/ast/src/cmd/ksh93/data/math.tab : : */

typedef Sfdouble_t (*Math_f) __PROTO__((Sfdouble_t,...));

#include <math.h>
#include <ieeefp.h>

static Sfdouble_t local_finite __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return finite(a1);}
static int local_fpclassify __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return fpclassify(a1);}
static int local_fpclass __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return fpclass(a1);}
static int local_isfinite __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return isfinite(a1);}
static int local_isgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isgreater(a1,a2);}
static int local_isgreaterequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isgreaterequal(a1,a2);}
static int local_isinf __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return isinf(a1);}
static int local_isless __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isless(a1,a2);}
static int local_islessequal __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessequal(a1,a2);}
static int local_islessgreater __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return islessgreater(a1,a2);}
static int local_isnormal __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return isnormal(a1);}
static int local_issubnormal __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){ int q = fpclassify(a1); return q == FP_SUBNORMAL; }
static int local_isunordered __PARAM__((Sfdouble_t a1,Sfdouble_t a2), (a1, a2)) __OTORP__(Sfdouble_t a1;Sfdouble_t a2;){return isunordered(a1,a2);}
static int local_iszero __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){ int q = fpclassify(a1); return q == FP_ZERO; }
static int local_signbit __PARAM__((Sfdouble_t a1), (a1)) __OTORP__(Sfdouble_t a1;){return signbit(a1);}

/*
 * first byte is two-digit octal number.  Last digit is number of args
 * first digit is 0 if return value is double, 1 for integer
 */
const struct mathtab shtab_math[] =
{
	"\001acos",	(Math_f)(uintptr_t)acosl,
	"\001acosh",	(Math_f)(uintptr_t)acoshl,
	"\001asin",	(Math_f)(uintptr_t)asinl,
	"\001asinh",	(Math_f)(uintptr_t)asinhl,
	"\001atan",	(Math_f)(uintptr_t)atanl,
	"\002atan2",	(Math_f)(uintptr_t)atan2l,
	"\001atanh",	(Math_f)(uintptr_t)atanhl,
	"\001cbrt",	(Math_f)(uintptr_t)cbrtl,
	"\001ceil",	(Math_f)(uintptr_t)ceill,
	"\002copysign",	(Math_f)(uintptr_t)copysignl,
	"\001cos",	(Math_f)(uintptr_t)cosl,
	"\001cosh",	(Math_f)(uintptr_t)coshl,
	"\001erf",	(Math_f)(uintptr_t)erfl,
	"\001erfc",	(Math_f)(uintptr_t)erfcl,
	"\001exp",	(Math_f)(uintptr_t)expl,
	"\001exp2",	(Math_f)(uintptr_t)exp2l,
	"\001expm1",	(Math_f)(uintptr_t)expm1l,
	"\001fabs",	(Math_f)(uintptr_t)fabsl,
	"\001abs",	(Math_f)(uintptr_t)fabsl,
	"\002fdim",	(Math_f)(uintptr_t)fdiml,
	"\001finite",	(Math_f)(uintptr_t)local_finite,
	"\001floor",	(Math_f)(uintptr_t)floorl,
	"\001int",	(Math_f)(uintptr_t)floorl,
	"\003fma",	(Math_f)(uintptr_t)fmal,
	"\002fmax",	(Math_f)(uintptr_t)fmaxl,
	"\002fmin",	(Math_f)(uintptr_t)fminl,
	"\002fmod",	(Math_f)(uintptr_t)fmodl,
	"\011fpclassify",	(Math_f)(uintptr_t)local_fpclassify,
	"\011fpclass",	(Math_f)(uintptr_t)local_fpclass,
	"\002hypot",	(Math_f)(uintptr_t)hypotl,
	"\011ilogb",	(Math_f)(uintptr_t)ilogbl,
	"\011isfinite",	(Math_f)(uintptr_t)local_isfinite,
	"\012isgreater",	(Math_f)(uintptr_t)local_isgreater,
	"\012isgreaterequal",	(Math_f)(uintptr_t)local_isgreaterequal,
	"\011isinf",	(Math_f)(uintptr_t)local_isinf,
	"\012isless",	(Math_f)(uintptr_t)local_isless,
	"\012islessequal",	(Math_f)(uintptr_t)local_islessequal,
	"\012islessgreater",	(Math_f)(uintptr_t)local_islessgreater,
	"\011isnan",	(Math_f)(uintptr_t)isnanl,
	"\011isnormal",	(Math_f)(uintptr_t)local_isnormal,
	"\011issubnormal",	(Math_f)(uintptr_t)local_issubnormal,
	"\012isunordered",	(Math_f)(uintptr_t)local_isunordered,
	"\011iszero",	(Math_f)(uintptr_t)local_iszero,
	"\001j0",	(Math_f)(uintptr_t)j0l,
	"\001j1",	(Math_f)(uintptr_t)j1l,
	"\002jn",	(Math_f)(uintptr_t)jnl,
	"\042ldexp",	(Math_f)(uintptr_t)ldexpl,
	"\001lgamma",	(Math_f)(uintptr_t)lgammal,
	"\001log",	(Math_f)(uintptr_t)logl,
	"\001log10",	(Math_f)(uintptr_t)log10l,
	"\001log1p",	(Math_f)(uintptr_t)log1pl,
	"\001log2",	(Math_f)(uintptr_t)log2l,
	"\001logb",	(Math_f)(uintptr_t)logbl,
	"\001nearbyint",	(Math_f)(uintptr_t)nearbyintl,
	"\002nextafter",	(Math_f)(uintptr_t)nextafterl,
	"\002nexttoward",	(Math_f)(uintptr_t)nexttowardl,
	"\002pow",	(Math_f)(uintptr_t)powl,
	"\002remainder",	(Math_f)(uintptr_t)remainderl,
	"\001rint",	(Math_f)(uintptr_t)rintl,
	"\001round",	(Math_f)(uintptr_t)roundl,
	"\002scalb",	(Math_f)(uintptr_t)scalbl,
	"\002scalbn",	(Math_f)(uintptr_t)scalbnl,
	"\011signbit",	(Math_f)(uintptr_t)local_signbit,
	"\001sin",	(Math_f)(uintptr_t)sinl,
	"\001sinh",	(Math_f)(uintptr_t)sinhl,
	"\001sqrt",	(Math_f)(uintptr_t)sqrtl,
	"\001tan",	(Math_f)(uintptr_t)tanl,
	"\001tanh",	(Math_f)(uintptr_t)tanhl,
	"\001tgamma",	(Math_f)(uintptr_t)tgammal,
	"\001trunc",	(Math_f)(uintptr_t)truncl,
	"\001y0",	(Math_f)(uintptr_t)y0l,
	"\001y1",	(Math_f)(uintptr_t)y1l,
	"\002yn",	(Math_f)(uintptr_t)ynl,
	"",		(Math_f)0
};
#endif