#include <Safety.hh>
Public Methods | |
Safety_ (bool Safediv=true) | |
ctor: set Safediv to true if you want to use the safe-division feature (default). | |
bool | safe_div () const |
safe_div(): returns the Usesafediv variable. More... | |
bool | safe_div (bool S) |
double | safe_div (double Num, double Denom, int Lineno=0) const |
safe_div(): returns Num/Denom if Denom is reliably non-0. More... | |
double | pythag (double a, double b) const |
pythag(): returns the value sqrt(a^2+b^2) without over- or underflows. More... | |
Static Public Methods | |
double | small () |
return the smallest number which can still divide 1.0 w/o problems. | |
Private Attributes | |
bool | Usesafediv |
use safe division check if set to true. | |
Static Private Attributes | |
Fparch_<double> | Fp |
double-precision floating-point consts. | |
const double | SMALL |
smallest non-0 for which 1.0/SMALL is OK. |
|
ctor: set Safediv to true if you want to use the safe-division feature (default).
|
|
return the smallest number which can still divide 1.0 w/o problems.
|
|
safe_div(): returns the Usesafediv variable. safe_div(S): sets Usesafediv, returns old value. |
|
|
|
safe_div(): returns Num/Denom if Denom is reliably non-0. If it is closer to 0 then the internal parameter SMALL, then it will be replaced by SMALL and the division is performed with a warning. The line number is printed when greater than 0 (default). |
|
pythag(): returns the value sqrt(a^2+b^2) without over- or underflows. On some machines the math library contains the function hypot(x, y) which does the same job and will be used whenever possible. |
|
double-precision floating-point consts.
|
|
smallest non-0 for which 1.0/SMALL is OK.
|
|
use safe division check if set to true.
|