18#define _USE_MATH_DEFINES
32static const double dbl_min_e_exp = (DBL_MIN_EXP - 1) * log(
double(FLT_RADIX));
36static const double dbl_max_e_exp = (DBL_MAX_EXP - 1) * log(
double(FLT_RADIX));
38static const double dbl_max_square =
sqrt(DBL_MAX);
40static const double flt_min_e_exp = (FLT_MIN_EXP - 1) * log(
double(FLT_RADIX));
41static const double flt_max_e_exp = (FLT_MAX_EXP - 1) * log(
double(FLT_RADIX));
43static const double flt_max_square =
sqrt(FLT_MAX);
46 return f >= 0 ? long(f) : -long(-f) - 1;
51 return x >= 0 ? x : -x;
56 if (x1 == x2)
return 1;
57 if (prec == 0)
return 0;
58 if (x1 == 0 && x2 == 0)
return 1;
59 if ((x1 < 0 && x2 > 0) || (x1 > 0 && x2 < 0))
return 0;
60 if (
tabs((x1 - x2) / (x1 + x2)) <= prec)
return 1;
long left_round(double f)
int apeq_mant(const T &x1, const T &x2, T prec)
DoubleAc sqrt(const DoubleAc &f)