Mercurial > octave
diff liboctave/lo-mappers.h @ 11010:9478b216752e
simplify more array tests
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 22 Sep 2010 07:06:25 +0200 |
parents | 4d1fc073fbb7 |
children | 94d9d412a2a0 |
line wrap: on
line diff
--- a/liboctave/lo-mappers.h Tue Sep 21 21:22:44 2010 -0400 +++ b/liboctave/lo-mappers.h Wed Sep 22 07:06:25 2010 +0200 @@ -211,4 +211,16 @@ extern OCTAVE_API Complex rc_sqrt (double); extern OCTAVE_API FloatComplex rc_sqrt (float); +// Some useful tests, that are commonly repeated. +// Test for a finite integer. +inline bool xisinteger (double x) +{ return xfinite (x) && x == xround (x); } +inline bool xisinteger (float x) +{ return xfinite (x) && x == xround (x); } + +// Test for negative sign. +extern OCTAVE_API bool xnegative_sign (double x); +extern OCTAVE_API bool xnegative_sign (float x); + + #endif