diff --git a/d0/d6f/namespaceothers.html b/d0/d6f/namespaceothers.html index 1b0bc61d0..e92e95aae 100644 --- a/d0/d6f/namespaceothers.html +++ b/d0/d6f/namespaceothers.html @@ -97,12 +97,24 @@ $(document).ready(function(){initNavTree('d0/d6f/namespaceothers.html','../../')
+
+Functions
others Namespace Reference

for vector More...

+ + + + + + + + +

+Functions

bool are_almost_equal (double a, double b, double absolute_tolerance=0.0001)
 Compare two floating point numbers with a certain tolerance. This is needed as with some values, the result (e.g.: -196.15) might be a bit lower (in this case, -196.499999...).
 
double kelvin_to_celsius (double temperature_in_k)
 Conversion from Kelvin to Celsius algorithm.
 

Detailed Description

for vector

for vector

@@ -114,7 +126,93 @@ $(document).ready(function(){initNavTree('d0/d6f/namespaceothers.html','../../')

Other algorithms

for assert for I/O operations

Other algorithms

-
+

Function Documentation

+ +

◆ are_almost_equal()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool others::are_almost_equal (double a,
double b,
double absolute_tolerance = 0.0001 
)
+
+ +

Compare two floating point numbers with a certain tolerance. This is needed as with some values, the result (e.g.: -196.15) might be a bit lower (in this case, -196.499999...).

+
Parameters
+ + + + +
athe first number to compare
bthe second number to compare
tolerancethe tolerance to use when comparing the numbers
+
+
+
Returns
true if the numbers ARE equal within the given tolerance
+
+false if the numbers are NOT equal within the given tolerance otherwise
+
40 {
+
41 return std::abs(a - b) < absolute_tolerance;
+
42}
+
+
+
+ +

◆ kelvin_to_celsius()

+ +
+
+ + + + + + + + +
double others::kelvin_to_celsius (double temperature_in_k)
+
+ +

Conversion from Kelvin to Celsius algorithm.

+
Parameters
+ + +
numberthe Celsius number that will be used to convert
+
+
+
Returns
the Kelvin number converted to Celsius
+
49 {
+
50 const double absolute_zero_in_c = -273.15;
+
51 if (temperature_in_k < absolute_zero_in_c) {
+
52 throw std::invalid_argument("input temperature below absolute zero");
+
53 }
+
54 return temperature_in_k + absolute_zero_in_c;
+
55}
+ +
+
+
+