24 #if !defined (octave_lo_mappers_h)
25 #define octave_lo_mappers_h 1
33 extern OCTAVE_API
double xtrunc (
double x);
34 extern OCTAVE_API
double xcopysign (
double x,
double y);
36 extern OCTAVE_API
double xfloor (
double x);
37 inline double arg (
double x) {
return atan2 (0.0, x); }
38 inline double conj (
double x) {
return x; }
40 inline double imag (
double) {
return 0.0; }
41 inline double real (
double x) {
return x; }
42 extern OCTAVE_API
double xround (
double x);
43 extern OCTAVE_API
double xroundb (
double x);
44 extern OCTAVE_API
double signum (
double x);
45 extern OCTAVE_API
double xlog2 (
double x);
47 extern OCTAVE_API
double xlog2 (
double x,
int& exp);
49 extern OCTAVE_API
double xexp2 (
double x);
52 inline bool xisnan (
bool) {
return false; }
53 inline bool xisnan (
char) {
return false; }
55 #if defined (HAVE_CMATH_ISNAN)
57 {
return std::isnan (x); }
59 extern OCTAVE_API
bool xisnan (
double x);
61 #if defined (HAVE_CMATH_ISFINITE)
63 {
return std::isfinite (x); }
65 extern OCTAVE_API
bool xfinite (
double x);
67 #if defined (HAVE_CMATH_ISINF)
69 {
return std::isinf (x); }
71 extern OCTAVE_API
bool xisinf (
double x);
80 return x <= y ? x : y;
86 return x >= y ? x : y;
95 return xisnan (y) ? x : (x <= y ? x : y);
101 return xisnan (y) ? x : (x >= y ? x : y);
118 extern OCTAVE_API
float xtrunc (
float x);
119 extern OCTAVE_API
float xcopysign (
float x,
float y);
120 inline float xceil (
float x) {
return ceilf (x); }
121 extern OCTAVE_API
float xfloor (
float x);
122 inline float arg (
float x) {
return atan2f (0.0
f, x); }
123 inline float conj (
float x) {
return x; }
125 inline float imag (
float) {
return 0.0f; }
126 inline float real (
float x) {
return x; }
127 extern OCTAVE_API
float xround (
float x);
128 extern OCTAVE_API
float xroundb (
float x);
129 extern OCTAVE_API
float signum (
float x);
130 extern OCTAVE_API
float xlog2 (
float x);
132 extern OCTAVE_API
float xlog2 (
float x,
int& exp);
134 extern OCTAVE_API
float xexp2 (
float x);
136 #if defined (HAVE_CMATH_ISNANF)
138 {
return std::isnan (x); }
140 extern OCTAVE_API
bool xisnan (
float x);
142 #if defined (HAVE_CMATH_ISFINITEF)
144 {
return std::isfinite (x); }
146 extern OCTAVE_API
bool xfinite (
float x);
148 #if defined (HAVE_CMATH_ISINFF)
150 {
return std::isinf (x); }
152 extern OCTAVE_API
bool xisinf (
float x);
160 return xisnan (y) ? x : (x <= y ? x : y);
166 return xisnan (y) ? x : (x >= y ? x : y);
230 extern OCTAVE_API
int NINT (
double x);
231 extern OCTAVE_API
int NINT (
float x);
233 template <
typename T>
245 template <
typename T>
252 template <
typename T>
259 template <
typename T>
266 template <
typename T>
273 template <
typename T>
280 template <
typename T>
287 template <
typename T>
294 template <
typename T>
301 template <
typename T>
307 return tmp == 0 ? 0.0 : x / tmp;
310 template <
typename T>
324 < std::numeric_limits<T>::epsilon ()))
331 volatile T tmp = y * n;
337 if (x != y && y != 0 && retval != 0)
343 template <
typename T>
357 < std::numeric_limits<T>::epsilon ()))
364 volatile T tmp = y * n;
370 if (x != y && y != 0 && retval != 0)
376 template <
typename T>
OCTAVE_API Complex atan(const Complex &x)
OCTAVE_API Complex asinh(const Complex &x)
OCTAVE_API int NINT(double x)
OCTAVE_API double xroundb(double x)
OCTAVE_API double xcopysign(double x, double y)
OCTAVE_API Complex rc_acos(double)
OCTAVE_API Complex acosh(const Complex &x)
OCTAVE_API double signum(double x)
OCTAVE_API bool octave_is_NA(double x)
OCTAVE_API Complex acos(const Complex &x)
OCTAVE_API float F_NINT(float x)
F77_RET_T const double const double * f
std::complex< T > ceil(const std::complex< T > &x)
OCTAVE_API bool octave_is_NaN_or_NA(const Complex &x)
OCTAVE_API double xlog2(double x)
OCTAVE_API octave_idx_type NINTbig(double x)
OCTAVE_API double xtrunc(double x)
OCTAVE_API Complex rc_asin(double)
OCTAVE_API double D_NINT(double x)
OCTAVE_API double xexp2(double x)
OCTAVE_API Complex rc_sqrt(double)
OCTAVE_API double xfloor(double x)
OCTAVE_API Complex rc_acosh(double)
SparseMatrix atan2(const double &x, const SparseMatrix &y)
OCTAVE_API bool xfinite(double x)
bool xisinteger(double x)
bool xpositive_sign(double x)
OCTAVE_API double xround(double x)
OCTAVE_API bool xisinf(double x)
OCTAVE_API Complex rc_log2(double)
std::complex< float > FloatComplex
OCTAVE_API Complex rc_log(double)
std::complex< T > floor(const std::complex< T > &x)
std::complex< double > Complex
OCTAVE_API Complex atanh(const Complex &x)
OCTAVE_API Complex rc_log10(double)
OCTAVE_API Complex rc_atanh(double)
F77_RET_T const double * x
OCTAVE_API Complex asin(const Complex &x)
OCTAVE_API bool xnegative_sign(double x)