![]() |
ENSDF++ 1.1
An easy, fast and simple way to run querys towards the ENSDF database, written in C++.
|
Contains important function(s) to compare double numbers. More...
#include <math.h>
Go to the source code of this file.
Defines | |
#define | MATH_H |
Inclusion guard. | |
#define | DOUBLEMATH_H |
Inclusion guard. | |
Functions | |
bool | doubleEquality (double d1, double d2, double eps=1E-9) |
Contains important function(s) to compare double numbers.
Definition in file DoubleMath.h.
bool doubleEquality | ( | double | d1, |
double | d2, | ||
double | eps = 1E-9 |
||
) | [inline] |
d1 | Number to compare with d2. |
d2 | Number to compare with d1. |
eps | Tolerance.Compares if two double numbers d1 and d2 has a relative difference smaller than a small number eps. |
Definition at line 14 of file DoubleMath.h.
Referenced by InterestingDecayIsomer::operator<(), LevelRecord::operator==(), InterestingDecayIsomer::operator==(), and Record_TEST::testLevelHalfLife().
{ if((d1+d2)!=0) return fabs(d1-d2)/(fabs(d1+d2))<=eps; else return (d1-d2)==0; }