Chaste Release::3.1
MathsCustomFunctions.hpp File Reference
#include <cfloat>
Include dependency graph for MathsCustomFunctions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CompareDoubles

Functions

double SmallPow (double x, unsigned exponent)
bool Divides (double smallerNumber, double largerNumber)

Detailed Description

This file contains some utility functions and a small class for dealing with floating point numbers.

Definition in file MathsCustomFunctions.hpp.


Function Documentation

bool Divides ( double  smallerNumber,
double  largerNumber 
)

Uses fmod to determine if smallerNumber divides the largerNumber. We expect smallerNumber/largerNumber <= 1 and therefore fmod(largerNumber,smallerNumber) should be close to zero or close to smallerNumber.

Parameters:
smallerNumberthe smaller
largerNumberthe larger

Definition at line 78 of file MathsCustomFunctions.cpp.

double SmallPow ( double  x,
unsigned  exponent 
)

Replacement "pow" function.

Parameters:
xnumber to be raised to a small power
exponentsmall integer exponent
Returns:
x^exponent a.k.a x**exponent.

Definition at line 41 of file MathsCustomFunctions.cpp.