comparison src/builtins.cc @ 330:fe6e790846f5

[project @ 1994-02-04 04:54:47 by jwe]
author jwe
date Fri, 04 Feb 1994 04:54:47 +0000
parents b851a7712cc7
children b1cc443f0bd1
comparison
equal deleted inserted replaced
329:a6be506559ec 330:fe6e790846f5
51 // The following initializations may eventually need to be reworked 51 // The following initializations may eventually need to be reworked
52 // like the builtin functions in bash were around version 1.12... 52 // like the builtin functions in bash were around version 1.12...
53 53
54 static builtin_mapper_functions mapper_functions[] = 54 static builtin_mapper_functions mapper_functions[] =
55 { 55 {
56 { "abs", 2, 1, 0, fabs, abs, NULL, 56 { "abs", 0, 0.0, 0.0, fabs, abs, NULL,
57 "abs (X): compute abs (X) for each element of X", }, 57 "abs (X): compute abs (X) for each element of X", },
58 58
59 { "acos", 2, 1, 0, acos, NULL, acos, 59 { "acos", 1, -1.0, 1.0, acos, NULL, acos,
60 "acos (X): compute acos (X) for each element of X", }, 60 "acos (X): compute acos (X) for each element of X", },
61 61
62 { "acosh", 2, 1, 0, acosh, NULL, acosh, 62 { "acosh", 1, 1.0, DBL_MAX, acosh, NULL, acosh,
63 "acosh (X): compute acosh (X) for each element of X", }, 63 "acosh (X): compute acosh (X) for each element of X", },
64 64
65 { "angle", 2, 1, 0, arg, arg, NULL, 65 { "angle", 0, 0.0, 0.0, arg, arg, NULL,
66 "angle (X): compute arg (X) for each element of X", }, 66 "angle (X): compute arg (X) for each element of X", },
67 67
68 { "arg", 2, 1, 0, arg, arg, NULL, 68 { "arg", 0, 0.0, 0.0, arg, arg, NULL,
69 "arg (X): compute arg (X) for each element of X", }, 69 "arg (X): compute arg (X) for each element of X", },
70 70
71 { "asin", 2, 1, 0, asin, NULL, asin, 71 { "asin", 1, -1.0, 1.0, asin, NULL, asin,
72 "asin (X): compute asin (X) for each element of X", }, 72 "asin (X): compute asin (X) for each element of X", },
73 73
74 { "asinh", 2, 1, 0, asinh, NULL, asinh, 74 { "asinh", 0, 0.0, 0.0, asinh, NULL, asinh,
75 "asinh (X): compute asinh (X) for each element of X", }, 75 "asinh (X): compute asinh (X) for each element of X", },
76 76
77 { "atan", 2, 1, 0, atan, NULL, atan, 77 { "atan", 0, 0.0, 0.0, atan, NULL, atan,
78 "atan (X): compute atan (X) for each element of X", }, 78 "atan (X): compute atan (X) for each element of X", },
79 79
80 { "atanh", 2, 1, 0, atanh, NULL, atanh, 80 { "atanh", 1, -1.0, 1.0, atanh, NULL, atanh,
81 "atanh (X): compute atanh (X) for each element of X", }, 81 "atanh (X): compute atanh (X) for each element of X", },
82 82
83 { "ceil", 2, 1, 0, ceil, NULL, ceil, 83 { "ceil", 0, 0.0, 0.0, ceil, NULL, ceil,
84 "ceil (X): round elements of X toward +Inf", }, 84 "ceil (X): round elements of X toward +Inf", },
85 85
86 { "conj", 2, 1, 0, conj, NULL, conj, 86 { "conj", 0, 0.0, 0.0, conj, NULL, conj,
87 "conj (X): compute complex conjugate for each element of X", }, 87 "conj (X): compute complex conjugate for each element of X", },
88 88
89 { "cos", 2, 1, 0, cos, NULL, cos, 89 { "cos", 0, 0.0, 0.0, cos, NULL, cos,
90 "cos (X): compute cos (X) for each element of X", }, 90 "cos (X): compute cos (X) for each element of X", },
91 91
92 { "cosh", 2, 1, 0, cosh, NULL, cosh, 92 { "cosh", 0, 0.0, 0.0, cosh, NULL, cosh,
93 "cosh (X): compute cosh (X) for each element of X", }, 93 "cosh (X): compute cosh (X) for each element of X", },
94 94
95 { "exp", 2, 1, 0, exp, NULL, exp, 95 { "exp", 0, 0.0, 0.0, exp, NULL, exp,
96 "exp (X): compute exp (X) for each element of X", }, 96 "exp (X): compute exp (X) for each element of X", },
97 97
98 { "finite", 2, 1, 0, xfinite, xfinite, NULL, 98 { "finite", 0, 0.0, 0.0, xfinite, xfinite, NULL,
99 "finite (X): return 1 for finite elements of X", }, 99 "finite (X): return 1 for finite elements of X", },
100 100
101 { "fix", 2, 1, 0, fix, NULL, fix, 101 { "fix", 0, 0.0, 0.0, fix, NULL, fix,
102 "fix (X): round elements of X toward zero", }, 102 "fix (X): round elements of X toward zero", },
103 103
104 { "floor", 2, 1, 0, floor, NULL, floor, 104 { "floor", 0, 0.0, 0.0, floor, NULL, floor,
105 "floor (X): round elements of X toward -Inf", }, 105 "floor (X): round elements of X toward -Inf", },
106 106
107 { "isinf", 2, 1, 0, xisinf, xisinf, NULL, 107 { "isinf", 0, 0.0, 0.0, xisinf, xisinf, NULL,
108 "isinf (X): return 1 for elements of X infinite", }, 108 "isinf (X): return 1 for elements of X infinite", },
109 109
110 { "imag", 2, 1, 0, imag, imag, NULL, 110 { "imag", 0, 0.0, 0.0, imag, imag, NULL,
111 "imag (X): return imaginary part for each elements of X", }, 111 "imag (X): return imaginary part for each elements of X", },
112 112
113 #ifdef HAVE_ISNAN 113 #ifdef HAVE_ISNAN
114 { "isnan", 2, 1, 0, xisnan, xisnan, NULL, 114 { "isnan", 0, 0.0, 0.0, xisnan, xisnan, NULL,
115 "isnan (X): return 1 where elements of X are NaNs", }, 115 "isnan (X): return 1 where elements of X are NaNs", },
116 #endif 116 #endif
117 117
118 { "log", 2, 1, 1, log, NULL, log, 118 { "log", 1, 0.0, DBL_MAX, log, NULL, log,
119 "log (X): compute log (X) for each element of X", }, 119 "log (X): compute log (X) for each element of X", },
120 120
121 { "log10", 2, 1, 1, log10, NULL, log10, 121 { "log10", 1, 0.0, DBL_MAX, log10, NULL, log10,
122 "log10 (X): compute log10 (X) for each element of X", }, 122 "log10 (X): compute log10 (X) for each element of X", },
123 123
124 { "real", 2, 1, 0, real, real, NULL, 124 { "real", 0, 0.0, 0.0, real, real, NULL,
125 "real (X): return real part for each element of X", }, 125 "real (X): return real part for each element of X", },
126 126
127 { "round", 2, 1, 0, round, NULL, round, 127 { "round", 0, 0.0, 0.0, round, NULL, round,
128 "round (X): round elements of X to nearest integer", }, 128 "round (X): round elements of X to nearest integer", },
129 129
130 { "sign", 2, 1, 0, signum, NULL, signum, 130 { "sign", 0, 0.0, 0.0, signum, NULL, signum,
131 "sign (X): apply signum function to elements of X", }, 131 "sign (X): apply signum function to elements of X", },
132 132
133 { "sin", 2, 1, 0, sin, NULL, sin, 133 { "sin", 0, 0.0, 0.0, sin, NULL, sin,
134 "sin (X): compute sin (X) for each element of X", }, 134 "sin (X): compute sin (X) for each element of X", },
135 135
136 { "sinh", 2, 1, 0, sinh, NULL, sinh, 136 { "sinh", 0, 0.0, 0.0, sinh, NULL, sinh,
137 "sinh (X): compute sinh (X) for each element of X", }, 137 "sinh (X): compute sinh (X) for each element of X", },
138 138
139 { "sqrt", 2, 1, 1, sqrt, NULL, sqrt, 139 { "sqrt", 1, 0.0, DBL_MAX, sqrt, NULL, sqrt,
140 "sqrt (X): compute sqrt (X) for each element of X", }, 140 "sqrt (X): compute sqrt (X) for each element of X", },
141 141
142 { "tan", 2, 1, 0, tan, NULL, tan, 142 { "tan", 0, 0.0, 0.0, tan, NULL, tan,
143 "tan (X): compute tan (X) for each element of X", }, 143 "tan (X): compute tan (X) for each element of X", },
144 144
145 { "tanh", 2, 1, 0, tanh, NULL, tanh, 145 { "tanh", 0, 0.0, 0.0, tanh, NULL, tanh,
146 "tanh (X): compute tanh (X) for each element of X", }, 146 "tanh (X): compute tanh (X) for each element of X", },
147 147
148 { NULL, -1, -1, -1, NULL, NULL, NULL, NULL, }, 148 { NULL, -1, 0.0, 0.0, NULL, NULL, NULL, NULL, },
149 }; 149 };
150 150
151 static builtin_text_functions text_functions[] = 151 static builtin_text_functions text_functions[] =
152 { 152 {
153 { "casesen", 2, builtin_casesen, 153 { "casesen", 2, builtin_casesen,