PSCF v1.1
|
Mathematical constants and utilities. More...
Classes | |
class | Util::Binomial |
Class for binomial coefficients (all static members) More... | |
class | Util::CardinalBSpline |
A cardinal B-spline basis function. More... | |
class | Util::Constants |
Mathematical constants. More... | |
class | Util::Polynomial< T > |
A Polynomial (i.e,. More... | |
class | Util::Rational |
A Rational number (a ratio of integers). More... | |
Functions | |
bool | Util::feq (double x, double y, double eps=1.0E-10) |
Are two floating point numbers equal to within round-off error? More... | |
int | Util::gcd (int a, int b) |
Compute greatest common divisor (gcd) of two integers. More... | |
Mathematical constants and utilities.
|
inline |
Are two floating point numbers equal to within round-off error?
Returns true if eps > fabs(x-y)*c/(fabs(x)+fabs(y)+c), c=1.05E-5.
x | first real argument |
y | second real argument |
eps | maximum tolerance for nominally "equal" values |
Definition at line 27 of file feq.h.
Referenced by Util::Distribution::loadParameters(), Util::RadialDistribution::loadParameters(), and Util::Distribution::serialize().
|
inline |
Compute greatest common divisor (gcd) of two integers.
Uses Euclidean algorithm to compute gcd. Always returns a non-negative integer. If one argument is zero, the absolute value of the other is returned. Returns zero if and only if both integers are zero.
a | 1st integer |
b | 2nd integer |