26#if defined (HAVE_CONFIG_H)
54 return (
isna (std::real (
x)) ||
isna (std::imag (
x)));
66 return (
isna (std::real (
x)) ||
isna (std::imag (
x)));
88 if (std::imag (
x) == 0.0 && std::real (
x) > 1.0)
99 if (std::imag (
x) == 0.0f && std::real (
x) > 1.0f)
100 return std::conj (y);
110 if (std::imag (
x) == 0.0 && std::real (
x) > 1.0)
111 return std::conj (y);
121 if (std::imag (
x) == 0.0f && std::real (
x) > 1.0f)
122 return std::conj (y);
142 return std::log (
x) / M_LN2;
148 return std::log (
x) /
static_cast<float> (M_LN2);
166 double ax = std::abs (
x);
167 double lax =
log2 (ax, exp);
168 return (ax != lax) ? (
x / ax) * lax :
x;
174 float ax = std::abs (
x);
175 float lax =
log2 (ax, exp);
176 return (ax != lax) ? (
x / ax) * lax :
x;
189 static constexpr double out_of_range_top
190 =
static_cast<double> (std::numeric_limits<octave_idx_type>::max ()) + 1.0;
192 if (
x >= out_of_range_top)
193 return std::numeric_limits<octave_idx_type>::max ();
194 else if (
x < std::numeric_limits<octave_idx_type>::min ())
195 return std::numeric_limits<octave_idx_type>::min ();
203 static constexpr float out_of_range_top
204 =
static_cast<float> (std::numeric_limits<octave_idx_type>::max ()) + 1.0;
206 if (
x >= out_of_range_top)
207 return std::numeric_limits<octave_idx_type>::max ();
208 else if (
x < std::numeric_limits<octave_idx_type>::min ())
209 return std::numeric_limits<octave_idx_type>::min ();
217 if (
x > std::numeric_limits<int>::max ())
218 return std::numeric_limits<int>::max ();
219 else if (
x < std::numeric_limits<int>::min ())
220 return std::numeric_limits<int>::min ();
222 return static_cast<int> (
round (
x));
228 static constexpr float out_of_range_top
229 =
static_cast<float> (std::numeric_limits<int>::max ()) + 1.0;
231 if (
x >= out_of_range_top)
232 return std::numeric_limits<int>::max ();
233 else if (
x < std::numeric_limits<int>::min ())
234 return std::numeric_limits<int>::min ();
236 return static_cast<int> (
round (
x));
299 return x < 0.0f ?
FloatComplex (std::log (-
x),
static_cast<float> (M_PI))
306 constexpr double PI_LN2 = 4.53236014182719380962;
313 constexpr float PI_LN2 = 4.53236014182719380962f;
321 constexpr double PI_LN10 = 1.36437635384184134748;
328 constexpr float PI_LN10 = 1.36437635384184134748f;
346OCTAVE_END_NAMESPACE(math)
347OCTAVE_END_NAMESPACE(octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
bool is_NaN_or_NA(const Complex &x)
Complex log2(const Complex &x)
Complex rc_acosh(double x)
Complex rc_atanh(double x)
Complex asin(const Complex &x)
octave_idx_type nint_big(double x)
Complex rc_asin(double x)
bool negative_sign(double x)
Complex rc_acos(double x)
Complex rc_sqrt(double x)
Complex rc_log10(double x)
Complex acos(const Complex &x)
Complex rc_log2(double x)
double frexp(double x, int *expptr)
double octave_frexp_wrapper(double x, int *expptr)
float octave_frexpf_wrapper(float x, int *expptr)
std::complex< double > Complex
std::complex< float > FloatComplex
F77_RET_T const F77_DBLE * x