CeylanMathsBasic.h File Reference

#include "CeylanException.h"
#include "CeylanTypes.h"
#include "CeylanFunctor.h"
#include <string>

Include dependency graph for CeylanMathsBasic.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Classes

class  Ceylan::Maths::MathsException
 Exception for Maths-related issues. More...
class  Ceylan::Maths::IntToIntFunctor
 A functor dealing with integers (one integer as parameter, returns integer). More...

Namespaces

namespace  Ceylan
 This part of the Ceylan namespace gathers some convenient string manipulation facilities to be widely used.
namespace  Ceylan::Maths
 Contains all maths-related operations and constants.

Typedefs

typedef Ceylan::Sint32 Ceylan::Maths::IntegerData
 Generic signed integer data.
typedef Ceylan::Float32 Ceylan::Maths::Real
 Real is the floating-point coordinate used in Ceylan's linear services.
typedef Ceylan::Float32 Ceylan::Maths::AngleInDegrees
 Angles, expressed in degrees.
typedef Ceylan::Float32 Ceylan::Maths::AngleInRadians
 Angles, expressed in radians.
typedef Ceylan::Uint8 Ceylan::Maths::Percentage
 Integer percentage values, which should range from 0 to 100, both included.
typedef Ceylan::Uint32 Ceylan::Maths::Hertz
 Unit for frequencies (Hz).
typedef Ceylan::Float32 Ceylan::Maths::Ratio
 Ratio unit, should store floating point values between 0 and 1.

Functions

CEYLAN_DLL bool Ceylan::Maths::IsNull (Ceylan::Float32 x)
 Tells whether x is null as regard to floating point numbers: | x | < EpsilonFloat32.
CEYLAN_DLL bool Ceylan::Maths::IsNull (Ceylan::Float32 x, Ceylan::Float32 epsilon)
 Tells whether x is null as regard to floating point numbers: | x | < epsilon.
CEYLAN_DLL bool Ceylan::Maths::IsNull (Ceylan::Float64 x)
 Tells whether x is null as regard to floating point numbers: | x | < EpsilonFloat64.
CEYLAN_DLL bool Ceylan::Maths::IsNull (Ceylan::Float64 x, Ceylan::Float64 epsilon)
 Tells whether x is null as regard to floating point numbers: | x | < epsilon.
CEYLAN_DLL bool Ceylan::Maths::IsNull (Ceylan::LongFloat x)
 Tells whether x is null as regard to floating point numbers: | x | < EpsilonLongFloat.
CEYLAN_DLL bool Ceylan::Maths::IsNull (Ceylan::LongFloat x, Ceylan::LongFloat epsilon)
 Tells whether x is null as regard to floating point numbers: | x | < epsilon.
CEYLAN_DLL bool Ceylan::Maths::AreEqual (Ceylan::Float32 x, Ceylan::Float32 y)
 Tells whether x and y are 'equal' as floating point numbers: | x - y | < EpsilonFloat32.
CEYLAN_DLL bool Ceylan::Maths::AreEqual (Ceylan::Float32 x, Ceylan::Float32 y, Ceylan::Float32 epsilon)
 Tells whether x and y are 'equal' as floating point numbers: | x - y | < epsilon.
CEYLAN_DLL bool Ceylan::Maths::AreEqual (Ceylan::Float64 x, Ceylan::Float64 y)
 Tells whether x and y are 'equal' as floating point numbers: | x - y | < EpsilonFloat64.
CEYLAN_DLL bool Ceylan::Maths::AreEqual (Ceylan::Float64 x, Ceylan::Float64 y, Ceylan::Float64 epsilon)
 Tells whether x and y are 'equal' as floating point numbers: | x - y | < epsilon.
CEYLAN_DLL bool Ceylan::Maths::AreExactlyEqual (Ceylan::Float64 x, Ceylan::Float64 y)
 Tells whether x and y are exactly 'equal': x == y, with no compile warning about the fact that comparing floating point values with == operator is most of the time absurd, which is true indeed.
CEYLAN_DLL bool Ceylan::Maths::AreEqual (Ceylan::LongFloat x, Ceylan::LongFloat y)
 Tells whether x and y are 'equal' as floating point numbers: | x - y | < EpsilonLongFloat.
CEYLAN_DLL bool Ceylan::Maths::AreEqual (Ceylan::LongFloat x, Ceylan::LongFloat y, Ceylan::LongFloat epsilon)
 Tells whether x and y are 'equal' as floating point numbers: | x - y | < epsilon.
template<typename T >
bool Ceylan::Maths::AreRelativelyEqual (T x, T y)
 Relative comparison.
template<typename T >
bool Ceylan::Maths::AreRelativelyEqual (T x, T y, Ceylan::LongFloat epsilon)
 Relative comparison with user-supplied epsilon.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Floor (Ceylan::Float32 x)
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Floor (Ceylan::Float64 x)
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Floor (Ceylan::LongFloat x)
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Ceil (Ceylan::Float32 x)
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Ceil (Ceylan::Float64 x)
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Ceil (Ceylan::LongFloat x)
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Round (Ceylan::Float32 x)
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Round (Ceylan::Float32 x, Ceylan::Uint8 precision)
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Round (Ceylan::Float64 x)
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Round (Ceylan::Float64 x, Ceylan::Uint8 precision)
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Round (Ceylan::LongFloat x)
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Round (Ceylan::LongFloat x, Ceylan::Uint8 precision)
CEYLAN_DLL Ceylan::Sint8 Ceylan::Maths::Abs (Ceylan::Sint8 x)
 Absolute value, polluted by ambiguous calls:.
CEYLAN_DLL Ceylan::Sint16 Ceylan::Maths::Abs (Ceylan::Sint16 x)
 Computes the absolute value of specified argument.
CEYLAN_DLL Ceylan::Sint32 Ceylan::Maths::Abs (Ceylan::Sint32 x)
 Computes the absolute value of specified argument.
CEYLAN_DLL
Ceylan::SignedLongInteger 
Ceylan::Maths::Abs (Ceylan::SignedLongInteger x)
 Computes the absolute value of specified argument.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Abs (Ceylan::Float32 x)
 Computes the absolute value of specified argument.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Abs (Ceylan::Float64 x)
 Computes the absolute value of specified argument.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Abs (Ceylan::LongFloat x)
 Computes the absolute value of specified argument.
template<typename T >
Ceylan::Maths::Min (T x, T y)
 Min:.
template<typename T >
Ceylan::Maths::Min (T x, T y, T z)
 Three-argument Min operator.
CEYLAN_DLL Ceylan::Sint8 Ceylan::Maths::Min (Ceylan::Sint8 x, Ceylan::Sint8 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::Uint8 Ceylan::Maths::Min (Ceylan::Uint8 x, Ceylan::Uint8 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::Sint16 Ceylan::Maths::Min (Ceylan::Sint16 x, Ceylan::Sint16 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::Uint16 Ceylan::Maths::Min (Ceylan::Uint16 x, Ceylan::Uint16 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::Sint32 Ceylan::Maths::Min (Ceylan::Sint32 x, Ceylan::Sint32 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::Uint32 Ceylan::Maths::Min (Ceylan::Uint32 x, Ceylan::Uint32 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL
Ceylan::SignedLongInteger 
Ceylan::Maths::Min (Ceylan::SignedLongInteger x, Ceylan::SignedLongInteger y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL
Ceylan::UnsignedLongInteger 
Ceylan::Maths::Min (Ceylan::UnsignedLongInteger x, Ceylan::UnsignedLongInteger y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Min (Ceylan::Float32 x, Ceylan::Float32 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Min (Ceylan::Float64 x, Ceylan::Float64 y)
 Returns the minimum value of specified parameters.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Min (Ceylan::LongFloat x, Ceylan::LongFloat y)
 Returns the minimum value of specified parameters.
template<typename T >
Ceylan::Maths::Max (T x, T y)
 Max:.
CEYLAN_DLL Ceylan::Sint8 Ceylan::Maths::Max (Ceylan::Sint8 x, Ceylan::Sint8 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Uint8 Ceylan::Maths::Max (Ceylan::Uint8 x, Ceylan::Uint8 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Sint16 Ceylan::Maths::Max (Ceylan::Sint16 x, Ceylan::Sint16 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Uint16 Ceylan::Maths::Max (Ceylan::Uint16 x, Ceylan::Uint16 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Sint32 Ceylan::Maths::Max (Ceylan::Sint32 x, Ceylan::Sint32 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Uint32 Ceylan::Maths::Max (Ceylan::Uint32 x, Ceylan::Uint32 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL
Ceylan::SignedLongInteger 
Ceylan::Maths::Max (Ceylan::SignedLongInteger x, Ceylan::SignedLongInteger y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL
Ceylan::UnsignedLongInteger 
Ceylan::Maths::Max (Ceylan::UnsignedLongInteger x, Ceylan::UnsignedLongInteger y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Max (Ceylan::Float32 x, Ceylan::Float32 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Max (Ceylan::Float64 x, Ceylan::Float64 y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Max (Ceylan::LongFloat x, Ceylan::LongFloat y)
 Returns the maximum value of specified parameters.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Exp (Ceylan::Float32 x)
 Computes the value of e (the base of natural logarithms) raised to the power of x.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Exp (Ceylan::Float64 x)
 Computes the value of e (the base of natural logarithms) raised to the power of x.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Exp (Ceylan::LongFloat x)
 Computes the value of e (the base of natural logarithms) raised to the power of x.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Pow (Ceylan::Float32 x, Ceylan::Float32 y)
 Computes the value of x raised to the power of y.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Pow (Ceylan::Float64 x, Ceylan::Float64 y)
 Computes the value of x raised to the power of y.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Pow (Ceylan::LongFloat x, Ceylan::LongFloat y)
 Computes the value of x raised to the power of y.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Pow2 (Ceylan::Float32 x)
 Computes the value of x² (x*x).
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Pow2 (Ceylan::Float64 x)
 Computes the value of x² (x*x).
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Pow2 (Ceylan::LongFloat x)
 Computes the value of x² (x*x).
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Log (Ceylan::Float32 x)
 Computes the value of the natural logarithm of argument x.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Log (Ceylan::Float64 x)
 Computes the value of the natural logarithm of argument x.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Log (Ceylan::LongFloat x)
 Computes the value of the natural logarithm of argument x.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Sqrt (Ceylan::Float32 x)
 Computes the non-negative square root of x.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Sqrt (Ceylan::Float64 x)
 Computes the non-negative square root of x.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Sqrt (Ceylan::LongFloat x)
 Computes the non-negative square root of x.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Cos (Ceylan::Float32 angle)
 Computes the cosine of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Cos (Ceylan::Float64 angle)
 Computes the cosine of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Cos (Ceylan::LongFloat angle)
 Computes the cosine of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Sin (Ceylan::Float32 angle)
 Computes the sine of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Sin (Ceylan::Float64 angle)
 Computes the sine of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Sin (Ceylan::LongFloat angle)
 Computes the sine of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::Float32 Ceylan::Maths::Tan (Ceylan::Float32 angle)
 Computes the tangent of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::Float64 Ceylan::Maths::Tan (Ceylan::Float64 angle)
 Computes the tangent of 'angle', where angle is given in radians.
CEYLAN_DLL Ceylan::LongFloat Ceylan::Maths::Tan (Ceylan::LongFloat angle)
 Computes the tangent of 'angle', where angle is given in radians.
CEYLAN_DLL AngleInRadians Ceylan::Maths::DegreeToRadian (AngleInDegrees angleInDegrees)
 Converts an angle expressed in degrees into an angle expressed in radians.
CEYLAN_DLL Uint16 Ceylan::Maths::NextPowerOfTwo (Uint16 value)
 Returns the first power of 2 greater or equal to the specified value.
CEYLAN_DLL bool Ceylan::Maths::IsAPowerOfTwo (Uint16 value)
 Tells whether the specified value is a power of two.
CEYLAN_DLL Uint16 Ceylan::Maths::NextMultipleOf (Uint16 multiple, Uint16 value)

Variables

CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::E
 The number e.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Log2E
 The number log_2(e).
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Log10E
 The number log_10(e).
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::LogE2
 The number log_e(2) = ln(2).
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::LogE10
 The number log_e(10) = ln(10) (used to be the M_LN10 maths.h constant).
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Pi
 The number pi.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Pi_div_2
 The number pi/2.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Pi_div_4
 The number pi/4.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::One_div_Pi
 The number 1/pi.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Two_div_Pi
 The number 2/pi.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Two_div_sqrt_Pi
 The number 2/sqrt(pi).
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Sqrt_2
 The number sqrt(2).
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::One_div_sqrt_2
 The number 1/sqrt(2).
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::EpsilonFloat32 = 1.0e-7
 A very small number, used for floating point comparisons: two numbers x and y are deemed equal if | x - y | < EpsilonFloat32.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::EpsilonFloat64 = 1.0e-9
 A very small number, used for floating point comparisons: two numbers x and y are deemed equal if | x - y | < EpsilonFloat64.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::EpsilonLongFloat = 1.0e-11
 A very small number, used for floating point comparisons: two numbers x and y are deemed equal if | x - y | < EpsilonLongFloat.
CEYLAN_DLL const Ceylan::LongFloat Ceylan::Maths::Epsilon = EpsilonFloat32
 A very small number, used for floating point comparisons: two numbers x and y are deemed equal if | x - y | < Epsilon.


Generated on Thu Jun 4 20:39:42 2009 for Ceylan by  doxygen 1.5.8