35 #include <itpp/itexports.h> 42 std::ostream& operator<<(std::ostream &os, const std::complex<T> &x)
45 ios::fmtflags saved_format = os.setf(ios::showpos);
47 os.setf(saved_format, ios::showpos);
53 std::istream& operator>>(std::istream &is, std::complex<T> &x)
63 x = complex<T>(re, im);
66 is.setstate(ios_base::failbit);
70 x = complex<T>(re, T(0));
73 is.setstate(ios_base::failbit);
79 if (!is.eof() && ((c =
static_cast<char>(is.peek())) ==
'+' || c ==
'-')) {
82 x = complex<T>(re, im);
85 is.setstate(ios_base::failbit);
89 x = complex<T>(re, T(0));
103 const double pi = 3.14159265358979323846;
109 const double eps = std::numeric_limits<double>::epsilon();
118 return (modf(x, &dummy) == 0.0);
122 inline bool is_even(
int x) {
return ((x&1) == 0); }
138 #endif // #ifndef MISC_H const double m_2pi
Constant 2*Pi.
bool is_bigendian()
Returns true if machine endianness is BIG_ENDIAN.
bool is_even(int x)
Return true if x is an even integer.
std::string itpp_version(void)
Returns IT++ library version number, e.g. "3.7.1".
const double eps
Constant eps.
bool is_int(double x)
Return true if x is an integer.
const double pi
Constant Pi.
bool check_big_endianness()
This function is deprecated. Please use is_bigendian() instead.