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:
smallerNumber the smaller
largerNumber the larger

Definition at line 71 of file MathsCustomFunctions.cpp.

double SmallPow ( double  x,
unsigned  exponent 
)

Replacement "pow" function.

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

Definition at line 34 of file MathsCustomFunctions.cpp.

Generated on Thu Dec 22 13:00:19 2011 for Chaste by  doxygen 1.6.3