comparison liboctave/lo-mappers.cc @ 4469:53ee020af847

[project @ 2003-07-26 03:45:10 by jwe]
author jwe
date Sat, 26 Jul 2003 03:45:11 +0000
parents efd8cd91857e
children 55211d6748c4
comparison
equal deleted inserted replaced
4468:efb6301dae80 4469:53ee020af847
131 // XXX FIXME XXX -- need to handle NA too? 131 // XXX FIXME XXX -- need to handle NA too?
132 132
133 double 133 double
134 xmin (double x, double y) 134 xmin (double x, double y)
135 { 135 {
136 return x < y ? x : (xisnan (x) ? x : y); 136 if (x < y)
137 return x;
138
139 if (y <= x)
140 return y;
141
142 if (octave_is_NaN_or_NA (x) && ! octave_is_NaN_or_NA (y))
143 return y;
144 else if (octave_is_NaN_or_NA (y) && ! octave_is_NaN_or_NA (x))
145 return x;
146 else if (octave_is_NA (x) || octave_is_NA (y))
147 return octave_NA;
148 else
149 return octave_NaN;
137 } 150 }
138 151
139 double 152 double
140 xmax (double x, double y) 153 xmax (double x, double y)
141 { 154 {
142 return x > y ? x : (xisnan (x) ? x : y); 155 if (x > y)
156 return x;
157
158 if (y >= x)
159 return y;
160
161 if (octave_is_NaN_or_NA (x) && ! octave_is_NaN_or_NA (y))
162 return y;
163 else if (octave_is_NaN_or_NA (y) && ! octave_is_NaN_or_NA (x))
164 return x;
165 else if (octave_is_NA (x) || octave_is_NA (y))
166 return octave_NA;
167 else
168 return octave_NaN;
143 } 169 }
144 170
145 // complex -> complex mappers. 171 // complex -> complex mappers.
146 172
147 Complex 173 Complex