Mercurial > hg > octave-nkf
comparison liboctave/numeric/lo-mappers.h @ 16971:259c1f295a1e
Use xfinite to replace some (isinf || isnan) instances in C++ code.
* libinterp/corefcn/graphics.cc(max_axes_scale, check_limit_vals, FIX_LIMITS,
update_axis_limits): Use xfinite.
* libinterp/corefcn/ls-mat5.cc(save_mat5_array_length): Use xfinite.
* libinterp/corefcn/pr-output.cc(pr_max_internal, pr_min_internal, set_format):
Use xfinite.
* liboctave/numeric/lo-mappers.h(X_NINT): Use xfinite.
* liboctave/numeric/oct-rand.cc(do_scalar, do_float_scalar, fill): Use xfinite.
* liboctave/util/lo-utils.cc(xtoo_large_for_float): Use xfinite.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 13 Jul 2013 08:08:15 -0700 |
parents | ecf5be238b4a |
children | d63878346099 |
comparison
equal
deleted
inserted
replaced
16970:78116b88dbf5 | 16971:259c1f295a1e |
---|---|
232 | 232 |
233 template <typename T> | 233 template <typename T> |
234 T | 234 T |
235 X_NINT (T x) | 235 X_NINT (T x) |
236 { | 236 { |
237 return (xisinf (x) || xisnan (x)) ? x : xfloor (x + 0.5); | 237 return (xfinite (x) ? xfloor (x + 0.5) : x); |
238 } | 238 } |
239 | 239 |
240 inline OCTAVE_API double D_NINT (double x) { return X_NINT (x); } | 240 inline OCTAVE_API double D_NINT (double x) { return X_NINT (x); } |
241 inline OCTAVE_API float F_NINT (float x) { return X_NINT (x); } | 241 inline OCTAVE_API float F_NINT (float x) { return X_NINT (x); } |
242 | 242 |