ENSDF++ 1.1
An easy, fast and simple way to run querys towards the ENSDF database, written in C++.
Defines | Functions
DoubleMath.h File Reference

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)

Detailed Description

Contains important function(s) to compare double numbers.

Author:
Rikard Lundmark

Definition in file DoubleMath.h.


Function Documentation

bool doubleEquality ( double  d1,
double  d2,
double  eps = 1E-9 
) [inline]
Parameters:
d1Number to compare with d2.
d2Number to compare with d1.
epsTolerance.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;
}
 All Classes Files Functions Variables Enumerations Enumerator Defines

Back to the main page of the Precalibrated Ion Beam Identification Detector project

Created by Rikard Lundmark