fpv Class Reference

floating point value (fpv) with status informations and safe operations More...

#include <fpv.h>

List of all members.

Public Member Functions

virtual double stringToValue (const char *stringValue)
 converts stringValue to double
 fpv (const double val)
 constructor (with check of val)
 fpv (const fpv &val)
 copy constructor (value = val.value; status = val.stat)
void printBitpattern (FILE *file=(FILE *) 0) const
 prints the bitpattern of the floating point value in hex format
void printBitpatternFormatted (FILE *file=0) const
 prints the formatted bitpattern of the floating point value (sign mantisse exponent)
fpv operator+ (const double addend) const
 returns this->value + addend in a fpv object
fpv operator+ (const fpv &addend) const
 returns this->value + addend in a fpv object
fpv operator- (const double &subtrahend) const
 returns this->value - subtrahend in a fpv object
fpv operator- (const fpv &subtrahend) const
 returns this->value - subtrahend in a fpv object
fpv operator* (const double multiplicand) const
 returns this->value * multiplicand in a fpv object
fpv operator* (const fpv &multiplicand) const
 returns this->value * multiplicand in a fpv object
fpv operator/ (const double denominator) const
 returns this->value / denominator in a fpv object
fpv operator/ (const fpv &denominator) const
 returns this->value / denominator in a fpv object
fpv operator% (const double denominator) const
 returns the remainder of this->value / denominator in a fpv object
fpv operator% (const fpv &denominator) const
 returns the remainder of this->value / denominator in a fpv object
fpvassignReciproc ()
 calculates this->value = 1 / this->value
fpv reciproc () const
 returns the reciproc value (1 / this->value) in a fpv object
fpvassignCeil ()
 Calculates the ceiling of this->value.
fpv ceil () const
 returns the ceiling of this->value in a fpv object
fpvassignFloor ()
 Calculates the floor of this->value.
fpv floor () const
 returns the floor of this->value in a fpv object
fpvassignInteger ()
 strips the decimal places from this->value
fpv integer () const
 copies the integer-part of this->value into a fpv object
fpvassignRound (const int decPlaces=0)
 rounds this->value to a specified number of decimal places
fpv round (const long decPlaces) const
 returns this->value rounded to a specified number of decimal places in a fpv object
fpv positive () const
 returns the absolute value of this->value in a fpv object
fpv negative () const
 returns a negative absolute value of this->value in a fpv object
fpv inv () const
 returns a fpv object with -this->value ( fpv = -value)
fpv pow (const double exponent)
 returns a fpv object with this->value pow exp
fpv sqrt () const
 returns the sqrt of this->value in a fpv object
fpv root (const long rootExp) const
 returns the rootExp-root of this->value in a fpv object
fpv log (const double base) const
 returns the base-logarithm of this->value in a fpv object
fpvassignRad ()
 converts from degree into rad (circular measure)
fpv rad () const
 returns the rad of this->value in a fpv object (deg to rad)
fpvassignDeg ()
 converts from rad (circular measure) to degree
fpv deg () const
 returns the degree measure of this->value in a fpv object (rad to deg)
fpvassignSin ()
 calculates the sinus of this->value
fpv sin () const
 returns the sinus of this->value in a fpv object
fpvassignASin ()
 calculates the arcus sinus of this->value
fpv asin () const
 returns the arcus sinus of this->value in a fpv object
fpvassignCos ()
 calculates the cosinus of this->value
fpv cos () const
 returns the cosinus of this->value in a fpv object
fpvassignACos ()
 calculates the arcus cosinus of this->value
fpv acos () const
 returns the arcus cosinus of this->value in a fpv object
fpvassignTan ()
 calculates the tangent of this->value
fpv tan () const
 returns the tangent of this->value in a fpv object
fpvassignATan ()
 calculates the arcus tangent of this->value
fpv atan () const
 returns the arcus tangent of this->value in a fpv object
fpvassignCot ()
 calculates the cotangent of this->value
fpv cot () const
 returns the cotangent of this->value in a fpv object
fpvassignACot ()
 calculates the arcus cotangent of this->value
fpv acot () const
 returns acot( this->value ) in a fpv object

Detailed Description

floating point value (fpv) with status informations and safe operations

This fpv class provides a 64 bit value in floating point format and safe functions and operations on these values.
The safe functions and operations prevent FPU traps (exceptions). This allows hardware and operating system independend software development.
The status of a fpv acts accumulative. This allows straight forward programming of huge mathematical operations and checking the status only at the end of all calculations.


Constructor & Destructor Documentation

fpv::fpv ( const double  val  )  [inline]

constructor (with check of val)

constructs an object with value = val

Parameters:
val the value for this object
See also:
number(), assignCopy(), operator =()
fpv::fpv ( const fpv val  )  [inline]

copy constructor (value = val.value; status = val.stat)

constructs a copy of the object val

Parameters:
val the object to be copied.
See also:
number(), assignCopy(), operator =()

Member Function Documentation

fpv fpv::acos (  )  const [inline]

returns the arcus cosinus of this->value in a fpv object

Returns:
A fpv containing the result of this operation.
The result will be in range of [ 0 .. +PI ]
Hint:
Before calling this function:
this->value must be in range of [ -1 .. +1 ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv fpv::acot (  )  const [inline]

returns acot( this->value ) in a fpv object

calculates the arcus cotangent of this->value and stores the result in a fpv object

Returns:
acot( this->value ). A fpv containing the result of this operation.
The result will be in range of ] 0 .. +PI [
Calculation:

if this->value < 0
this->value = acot( this->value ) = atan2( 1, this->value ) + PI
else (if this->value >= 0)
this->value = acot( this->value ) = atan2( 1, this->value )
Hint:
Before calling this function:
this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv fpv::asin (  )  const [inline]

returns the arcus sinus of this->value in a fpv object

this->value must be in range of [-1 .. +1]

Returns:
A fpv containing the result of this operation.
The result will be in range of [ -PI/2 .. +PI/2 ]
Hint:
Before calling this function:
this->value must be in range of [ -1 .. +1 ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignACos (  )  [inline]

calculates the arcus cosinus of this->value

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ 0 .. +PI ]
Hint:
Before calling this function:
this->value must be in range of [ -1 .. +1 ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignACot (  )  [inline]

calculates the arcus cotangent of this->value

Returns:
The reference to this fpv containing the result of this operation.
The result will be in range of [ 0 .. +PI ]
Hint:
Before calling this function:
this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]

Calculation:
if this->value < 0
this->value = acot( this->value ) = atan2( 1, this->value ) + PI
else (if this->value >= 0)
this->value = acot( this->value ) = atan2( 1, this->value )
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignASin (  )  [inline]

calculates the arcus sinus of this->value

this->value must be in range of [-1 .. +1]

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -PI/2 .. +PI/2 ]
Hint:
Before calling this function:
this->value must be in range of [ -1 .. +1 ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignATan (  )  [inline]

calculates the arcus tangent of this->value

this->value = atan( this->value )

Returns:
The reference to this fpv containing the result of this operation.
The result will be in range of ] -PI/2 .. +PI/2 [
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignCeil (  )  [inline]

Calculates the ceiling of this->value.

Calculates the smallest integer that is greater than or equal to this->value before calling this method

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
This method uses the standard C function ceil() and assigns the result to itself.
Examples:
fpv ceilPositiveValue( 2.1 );
ceilPositiveValue.assignCeil();
printf("\n ceil of %f = %f", 2.1, ceilPositiveValue.value);
fpv ceilNegativeValue( -2.9 );
ceilNegativeValue.assignCeil();
printf("\n ceil of %f = %f", -2.9, ceilNegativeValue.value);
Outputs:
ceil of 2.1 = 3.0
ceil of -2.9 = -2.0
fpv& fpv::assignCos (  )  [inline]

calculates the cosinus of this->value

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -1 .. +1 ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignCot (  )  [inline]

calculates the cotangent of this->value

Returns:
The reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
except the values k*pi (for k element N)

this->value = cot( this->value ) = cos( this->value ) / sin( this->value )
if sin( this->value ) = 0 then the status bit trigonCotErr will be set
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignDeg (  )  [inline]

converts from rad (circular measure) to degree

interpretes this->value as rad and returns it in degree
this->value = this->value * 180 / PI

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX*PI/180 .. +DBL_MAX*PI/180 ]
See also:
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignFloor (  )  [inline]

Calculates the floor of this->value.

Calculates the largest integer that is less than or equal to this->value before calling this method

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
This method uses the standard C function floor() and assigns the result to itself.
Examples:
fpv floorPositiveValue( 2.1 );
floorPositiveValue.assignCeil();
printf("\n floor of %f = %f", 2.1, floorPositiveValue.value);
fpv floorNegativeValue( -2.9 );
floorNegativeValue.assignCeil();
printf("\n floor of %f = %f", -2.9, floorNegativeValue.value);
Outputs:
floor of 2.1 = 2.0
floor of -2.9 = -3.0
fpv& fpv::assignInteger (  )  [inline]

strips the decimal places from this->value

Extracts the integer part from this->value

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
for positive values this method uses assignFloor()
and for negative values the method assignCeil() is used

The status bit int64overflow will be set, if this->value is out of range [LONG_LONG_MIN..LONG_LONG_MAX].
In case of this->value < LONG_LONG_MIN the status bit negative will also be set.
Notice:
Also in case of int64overflow, this->value always represents the mathematical correct integer value!!!
In other words: this->value will not be limitted to an integer range.
int64overflow is a usefull information before casting this->value into a int64 variable.
Example:
fpv val( -DBL_MAX ); //will be limited to -DBL_MAX
fpv result = val.integer();
fpv expected; //in result
expected.value = -DBL_MAX;
expected.negative = 1;
expected.overflow = 1;
expected.int64overflow = 1;
fpv& fpv::assignRad (  )  [inline]

converts from degree into rad (circular measure)

interpretes this->value as degree and converts to rad (circular measure)
this->value = this->value * PI / 180

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX*PI/180 .. +DBL_MAX*PI/180 ]
Hint:
Before calling this function:
- this->value will be interpreted in degree.
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignReciproc (  )  [inline]

calculates this->value = 1 / this->value

calculates the reciproc value of this->value

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
fpv& fpv::assignRound ( const int  decPlaces = 0  )  [inline]

rounds this->value to a specified number of decimal places

Parameters:
decPlaces Positive number indicates how many places to the right of the decimal are included in the rounding.
If omitted (decPlaces=0), assignRound() rounds to integer.
Negative number indicates how many places to the left of the decimal are included in the rounding.
Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
For negative values this formula will be used to calculate the rounded value:
this->value = ( this->value * 10^decPlaces - 0.5 ) / 10^decPlaces
For positive values this formula will be used to calculate the rounded value:
this->value = ( this->value * 10^decPlaces + 0.5 ) / 10^decPlaces
fpv& fpv::assignSin (  )  [inline]

calculates the sinus of this->value

and stores the result in this object
this->value = sin( this->value ).

Returns:
Reference to this fpv containing the result of this operation
The result will be in range of [ -1 .. +1 ]
Hint:
Before calling this function:
this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv& fpv::assignTan (  )  [inline]

calculates the tangent of this->value

Returns:
The reference to this fpv containing the result of this operation
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
except the values k*PI/2 (for k element N and k != 0)

With 64 bits, pi/2 is not so exact that tan( pi/2 ) will overflow.
In other words: Don't worry about the poles within the tan-function.
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv fpv::atan (  )  const [inline]

returns the arcus tangent of this->value in a fpv object

Returns:
A fpv containing the result of this operation.
The result will be in range of [ -PI/2 .. +PI/2 ]
Hint:
Before calling this function:
this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv fpv::ceil (  )  const [inline]

returns the ceiling of this->value in a fpv object

Returns:
A fpv containing the smallest integer that is greater than or equal to this->value
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
This method uses the standard C function ceil().
This object remains unchanged.
Examples:
fpv posVal( 2.1 );
fpv ceilPositiveValue = posVal.ceil();
printf("\n ceil of %f = %f", posVal.value, ceilPositiveValue.value);
fpv negVal( -2.9 );
ceilNegativeValue = negVal.ceil();
printf("\n ceil of %f = %f", negVal.value, ceilNegativeValue.value);
Outputs:
ceil of 2.1 = 3.0
ceil of -2.9 = -2.0
fpv fpv::cos (  )  const [inline]

returns the cosinus of this->value in a fpv object

Returns:
A fpv containing the result of this operation.
The result will be in range of [ -1 .. +1 ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv fpv::cot (  )  const [inline]

returns the cotangent of this->value in a fpv object

Returns:
A fpv containing the result of this operation
The returned value is in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
except the values k*pi (for k element N)

result = cot( this->value ) = cos( this->value ) / sin( this->value )
if sin( this->value ) = 0 then the status bit trigonCotErr will be set
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv fpv::deg (  )  const [inline]

returns the degree measure of this->value in a fpv object (rad to deg)

converts from rad (circular measure) into deg (degree)
fpv result = this->value * 180 / PI

Returns:
A fpv object containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX*PI/180 .. +DBL_MAX*PI/180 ]
See also:
assignRad(), rad(), assignDeg(), deg()
fpv fpv::floor (  )  const [inline]

returns the floor of this->value in a fpv object

Returns:
A fpv containing the largest integer that is less than or equal to this->value
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
This method uses the standard C function floor().
This object remains unchanged.
Examples:
fpv posVal( 2.1 );
fpv floorPositiveValue = posVal.floor();
printf("\n floor of %f = %f", posVal.value, floorPositiveValue.value);
fpv negVal( -2.9 );
floorNegativeValue = negVal.floor();
printf("\n floor of %f = %f", negVal.value, floorNegativeValue.value);
Outputs:
floor of 2.1 = 2.0
floor of -2.9 = -3.0
fpv fpv::integer (  )  const [inline]

copies the integer-part of this->value into a fpv object

Returns:
A fpv object containing the integer part of this->value
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
This object remains unchanged.
Hint:
This object remains unchanged For details of the conversion please refer to assignInteger()
fpv fpv::inv (  )  const [inline]

returns a fpv object with -this->value ( fpv = -value)

returns -( this->value )

Returns:
A fpv-object containing the value
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
This object remains unchanged (method is const)
See also:
assignInv(), inv(), assignAbs(), abs(), assignNeg(), neg()
fpv fpv::log ( const double  base  )  const [inline]

returns the base-logarithm of this->value in a fpv object

the log-function solves the equation
base ^ result = this->value
and returns a fpv object containing result

Parameters:
base the base of the logarithm (useful >= 2)
Returns:
A fpv object containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignRoot(), root(), assignSqrt(), sqrt(),
assignPow(), pow(), operator ^ (), operator ^= (), assignLog(), log()
fpv fpv::negative (  )  const [inline]

returns a negative absolute value of this->value in a fpv object

fpv-object = -fabs( this->value )

Returns:
A fpv-object containing the negative absolute value
The result will be in range of [ -DBL_MAX .. -0 ]
Hint:
This object remains unchanged (method is const)
See also:
assignInv(), inv(), assignAbs(), abs(), assignNeg(), neg()
fpv fpv::operator% ( const fpv denominator  )  const [inline]

returns the remainder of this->value / denominator in a fpv object

Parameters:
denominator the value to be divided from this->value to calculate the remainder
Returns:
A fpv containing the result of the operation.
If denominator <> 0 the result will be in range of ] -denominator .. +denominator [
If denominator == 0 the result will be this->value
See also:
assignMod()
fpv fpv::operator% ( const double  denominator  )  const [inline]

returns the remainder of this->value / denominator in a fpv object

Parameters:
denominator the value to be divided from this->value to calculate the remainder
Returns:
A fpv containing the result of the operation.
The result will be in range of ] -denominator .. +denominator [
See also:
assignMod()
fpv fpv::operator* ( const fpv multiplicand  )  const [inline]

returns this->value * multiplicand in a fpv object

Parameters:
multiplicand the value to be multiplied with this->value
Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignMul()
fpv fpv::operator* ( const double  multiplicand  )  const [inline]

returns this->value * multiplicand in a fpv object

Parameters:
multiplicand the value to be multiplied with this->value
Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignMul()
fpv fpv::operator+ ( const fpv addend  )  const [inline]

returns this->value + addend in a fpv object

Parameters:
addend the value to be added to this->value
Returns:
A fpv object containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignAdd()
fpv fpv::operator+ ( const double  addend  )  const [inline]

returns this->value + addend in a fpv object

Parameters:
addend the value to be added to this->value
Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignAdd()
fpv fpv::operator- ( const fpv subtrahend  )  const [inline]

returns this->value - subtrahend in a fpv object

Parameters:
subtrahend the value to be subtracted from this->value
Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSub()
fpv fpv::operator- ( const double &  subtrahend  )  const [inline]

returns this->value - subtrahend in a fpv object

Parameters:
subtrahend the value to be subtracted from this->value
Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSub()
fpv fpv::operator/ ( const fpv denominator  )  const [inline]

returns this->value / denominator in a fpv object

Parameters:
denominator the value to be divided from this->value
Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignDiv()
fpv fpv::operator/ ( const double  denominator  )  const [inline]

returns this->value / denominator in a fpv object

Parameters:
denominator the value to be divided from this->value
Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignDiv()
fpv fpv::positive (  )  const [inline]

returns the absolute value of this->value in a fpv object

fpv-object = fabs( this->value )

Returns:
A fpv-object containing the absolute value
The result will be in range of [ 0 .. +DBL_MAX ]
Hint:
This object remains unchanged (method is const)
See also:
assignInv(), inv(), assignAbs(), abs(), assignNeg(), neg()
fpv fpv::pow ( const double  exponent  )  [inline]

returns a fpv object with this->value pow exp

Parameters:
exponent the exponent
Returns:
A fpv object containing the result of the operation.
The result will be in range of the data type numType
See also:
assignRoot(), root(), assignSqrt(), sqrt(),
assignPow(), pow(), assignLog(), log()
void fpv::printBitpattern ( FILE *  file = (FILE*)0  )  const [inline]

prints the bitpattern of the floating point value in hex format

Parameters:
file pointer to a open FILE with write access.
If file=0 (default) this function prints to stdout.
If file is a valid pointer this function prints to file.
Example:
fpv myFloat = 123.456;
myFloat.printBitpattern();
Result:
405edd2f1a9fbe77
Illustration:

4 0 5 e d d 2 f 1 a 9 f b e 7 7
Bit 63..0
0100 0000 0101 1110 1101 1101 0010 1111 0001 1010 1001 1111 1011 1110 0111 0111
Bit 51..0: normalized significand
Bit 62..52: exponent
Bit 63: sign
See also:
printBitpatFmt()
void fpv::printBitpatternFormatted ( FILE *  file = 0  )  const [inline]

prints the formatted bitpattern of the floating point value (sign mantisse exponent)

Parameters:
file pointer to a open FILE with write access.
If file=0 (default) this function prints to stdout.
If file is a valid pointer this function prints to file.
Example:
fpv myFloat = 123.456;
myFloat.printBitpatternFormatted();
Result:
sign=0 significant=edd2f1a9fbe77 exponent=405
Hint:
All printed values are in hex-format.
See also:
printBitpat()
fpv fpv::rad (  )  const [inline]

returns the rad of this->value in a fpv object (deg to rad)

interpretes this->value as degree and returns it in rad (circular measure)
fpv result = this->value * PI / 180

Returns:
A fpv object containing the result of the operation.
The result will be in range of [ -DBL_MAX*PI/180 .. +DBL_MAX*PI/180 ]
Hint:
Before calling this function:
- this->value will be interpreted in degree.
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignRad(), rad(), assignDeg(), deg()
fpv fpv::reciproc (  )  const [inline]

returns the reciproc value (1 / this->value) in a fpv object

calculates the reciproc value of this->value

Returns:
A fpv containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignReciproc()
fpv fpv::root ( const long  rootExp  )  const [inline]

returns the rootExp-root of this->value in a fpv object

Returns:
A fpv object containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignRoot(), root(), assignSqrt(), sqrt(),
assignPow(), pow(), operator ^ (), operator ^= (), assignLog(), log()
fpv fpv::round ( const long  decPlaces  )  const [inline]

returns this->value rounded to a specified number of decimal places in a fpv object

Parameters:
decPlaces Positive number indicates how many places to the right of the decimal are included in the rounding.
If omitted (decPlaces=0), round() rounds to integer.
Negative number indicates how many places to the left of the decimal are included in the rounding.
Returns:
A fpv object containing the rounded value.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
This object remains unchanged.
fpv fpv::sin (  )  const [inline]

returns the sinus of this->value in a fpv object

Returns:
sin( this->value ). A fpv containing the result of this operation.
The result will be in range of [ -1 .. +1 ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()
fpv fpv::sqrt (  )  const [inline]

returns the sqrt of this->value in a fpv object

Returns:
A fpv object containing the result of the operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
See also:
assignRoot(), root(), assignSqrt(), sqrt(),
assignPow(), pow(), operator ^ (), operator ^= (), assignLog(), log()
virtual double fpv::stringToValue ( const char *  stringValue  )  [inline, virtual]

converts stringValue to double

Parameters:
stringValue pointer to the first character in the string where the value begins
Returns:
the value in double format
Hint:
This method uses strtod() to convert the string into a 64 bit float value.
If the string converting failed with errno = ERANGE (overflow),
the status bits strErr and overflow will be set bms.
In case of a negative overflow the status bit negative will also be set.
If there are no valid characters in the string
the status bits strErr and undef will be set in bms.
fpv fpv::tan (  )  const [inline]

returns the tangent of this->value in a fpv object

Returns:
A fpv containing the result of this operation.
The result will be in range of [ -DBL_MAX .. +DBL_MAX ]
Hint:
Before calling this function:
- this->value will be interpreted in rad (circular measure).
- this->value must be in range of [ -DBL_MAX .. +DBL_MAX ]
except the values k*PI/2 (for k element N and k != 0)

With 64 bits, pi/2 is not so exact that tan( pi/2 ) will overflow.
In other words: Don't worry about the poles within the tan-function.
See also:
assignSin(), sin(), assignCos(), cos(), assignTan(), tan(), assignCot(), cot()
assignASin(), asin(), assignACos(), acos(), assignATan(), atan(), assignACot(), acot()
assignRad(), rad(), assignDeg(), deg()

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Defines
Generated on Mon Nov 22 06:27:34 2010 by  doxygen 1.6.3