siv Class Reference

signed integer value (siv) with status informations and safe operations More...

#include <siv.h>

List of all members.

Public Member Functions

virtual __int64 stringToValue (const char *stringValue)
 converts stringValue to a number of type numType
 siv (const __int64 val)
 constructor (value = val)
 siv (const siv &val)
 copy constructor (value = val.value; status = val.stat)
void printBitpat (FILE *file=0) const
 prints the bitpattern of the signed integer value in hex format
sivassignCopy (const double val)
 rounds a 64-bit floating point value into a 64-bit integer
sivassignCopy (const char *strVal)
 converts and assigns a numerical decimal string to this siv
sivoperator= (const double val)
 assign operator to copy a 64-bit floating point value
siv operator+ (const __int64 addend) const
 returns this->value + addend in a siv object
siv operator+ (const siv &addend) const
 returns this->value + addend in a siv object
siv operator- (const __int64 &subtrahend) const
 returns this->value - subtrahend in a siv object
siv operator- (const siv &subtrahend) const
 returns this->value - subtrahend in a siv object
siv operator* (const __int64 multiplicand) const
 returns this->value * multiplicand in a siv object
siv operator* (const siv &multiplicand) const
 returns this->value * multiplicand in a siv object
sivassignReciproc ()
 calculates this->value = 1 / this->value
siv reciproc () const
 returns the reciproc value (1 / this->value) in a siv object
siv operator/ (const __int64 denominator) const
 returns this->value / denominator in a siv object
siv operator/ (const siv &denominator) const
 returns this->value / denominator in a siv object
siv operator% (const __int64 denominator) const
 returns the remainder of this->value / denominator in a siv object
siv operator% (const siv &denominator) const
 returns the remainder of this->value / denominator in a siv object
siv positive () const
 returns the absolute value of this->value in a siv object
siv negative () const
 returns a negative absolute value of this->value in a siv object
siv absMin (const siv &val) const
 returns the orig. value with minimum of both absolute values in a siv object
siv invertSign () const
 changes the sign of this value and stores the result in a new siv-object
siv pow (const int exp)
 calculates this->value = this->value pow exp
siv sqrt () const
 returns sqrt this->value in a siv object
sivassignAnd (const __int64 val)
 this->value &= val (bitwise AND)
sivoperator&= (const __int64 val)
 this->value &= val (bitwise AND)
siv and (const __int64 val) const
 result = this->value & val (bitwise AND)
siv operator& (const __int64 val) const
 returns this->value & val in a siv-object ( value & exp )
sivassignOr (const __int64 val)
 this->value |= val (bitwise OR)
sivoperator|= (const __int64 val)
 this->value |= val (bitwise OR)
siv or (const __int64 val) const
 result = this->value | val (bitwise OR)
siv operator| (const __int64 val) const
 returns this->value | val in a siv-object (bitwise OR)
sivassignBitwiseNot ()
 this->value = ~this->value (bitwise NOT)
siv bitwiseNot ()
 result = ~this->value (bitwise NOT)
sivoperator~ ()
 result = ~this->value (bitwise NOT)
sivassignXor (const __int64 val)
 this->value ^= val (bitwise exclusive OR)
sivoperator^= (const __int64 val)
 this->value ^= val (bitwise exclusive OR)
siv xor (const __int64 val) const
 result = this->value ^ val (bitwise exclusive OR)
siv operator^ (const __int64 val) const
 returns this->value ^ val in a siv-object (bitwise exclusive OR)
sivassignShiftLeft (const int cnt)
 this->value <<= cnt (bitwise shift left, insert 0)
sivoperator<<= (const int cnt)
 this->value <<= cnt (bitwise shift left and reasign)
siv shiftLeft (const int cnt) const
 result = this->value << cnt (bitwise shift left)
siv operator<< (const int cnt)
 result = this->value << cnt (bitwise shift left)
sivassignShiftRight (const int cnt)
 this->value >>= cnt (bitwise shift right, insert 0)
sivoperator>>= (const int cnt)
 this->value >>= cnt (bitwise shift right and reasign)
siv shiftRight (const int cnt) const
 result = this->value >> cnt (bitwise shift right)
siv operator>> (const int cnt)
 result = this->value >> cnt (bitwise shift left)
sivassignRotLeft (const int cnt)
 this->value = this->rotLeft( cnt ) (bitwise rotate left)
siv rotLeft (const int cnt) const
 result = this->value rotLeft cnt (bitwise rotate left)
sivassignRotRight (const int cnt)
 this->value rotRight cnt (bitwise rotate right)
siv rotRight (const int cnt) const
 result = this->value rotRight cnt (bitwise rotate right)

Detailed Description

signed integer value (siv) with status informations and safe operations

This siv class provides a 64 bit signed value in integer format and safe functions and operations on these values.
The safe functions and operations prevent exceptions like divide by zero. This allows hardware and operating system independend software development.
The status of a siv 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

siv::siv ( const __int64  val  )  [inline]

constructor (value = val)

constructs a siv object with value = val

Parameters:
val the signed integer value
See also:
siv(), assignCopy(), operator =()
siv::siv ( const siv val  )  [inline]

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

constructs a copy of the siv object val

Parameters:
val the signed integer value to be copied.
See also:
siv(), assignCopy(), operator =()

Member Function Documentation

siv siv::absMin ( const siv val  )  const [inline]

returns the orig. value with minimum of both absolute values in a siv object

if ( abs( this->value ) <= abs( val ) )
return *this
else return val

Parameters:
val the value to be compared with
Returns:
The original object containing the minimum absolute value of both
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
Example:
val=-3 this=-2 -->> returns -2
val=-3 this= 2 -->> returns 2
val= 3 this=-2 -->> returns -2
val= 3 this= 2 -->> returns 2
Hint:
No value will be changed. Only the compare is made with absolute values.
See also:
assignInv(), inv(), assignAbs(), abs(), assignNeg(), neg()
siv siv::and ( const __int64  val  )  const [inline]

result = this->value & val (bitwise AND)

Parameters:
val the bit-mask
Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::assignAnd ( const __int64  val  )  [inline]

this->value &= val (bitwise AND)

Parameters:
val the bit-mask
Returns:
Reference to this object containing the result of the operation
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::assignBitwiseNot (  )  [inline]

this->value = ~this->value (bitwise NOT)

Returns:
Reference to this object containing the result of the operation
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::assignCopy ( const char *  strVal  )  [inline]

converts and assigns a numerical decimal string to this siv

Parameters:
strVal pointer to the first character in the string where the value begins
Returns:
Reference to this siv object
Hint:
This operator uses _atoi64() to convert the string into a 64 bit integer value.
Between a sign character and the first number no white spaces are allowed.
If the string converting failes, the status bit strErr will be set.
See also:
assignCopy(), operator =
siv& siv::assignCopy ( const double  val  )  [inline]

rounds a 64-bit floating point value into a 64-bit integer

Parameters:
val the 64-bit float value to be copied into this siv object
Returns:
Reference to this siv object
See also:
assignCopy(), operator =
siv& siv::assignOr ( const __int64  val  )  [inline]

this->value |= val (bitwise OR)

Parameters:
val the bit-mask
Returns:
Reference to this object containing the result of the operation
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::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_VALUE .. +DBL_MAX_VALUE ]
siv& siv::assignRotLeft ( const int  cnt  )  [inline]

this->value = this->rotLeft( cnt ) (bitwise rotate left)

Parameters:
cnt number of bits to be rotated
example: 1001 rotLeft 2 (result = 0110)
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::assignRotRight ( const int  cnt  )  [inline]

this->value rotRight cnt (bitwise rotate right)

Parameters:
cnt number of bits to be rotated
example: 0001 rotRight 2 (result = 0100)
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::assignShiftLeft ( const int  cnt  )  [inline]

this->value <<= cnt (bitwise shift left, insert 0)

Parameters:
cnt number of bits to be shift
example: 0001 << 2 (result = 0100)
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::assignShiftRight ( const int  cnt  )  [inline]

this->value >>= cnt (bitwise shift right, insert 0)

Parameters:
cnt number of bits to be shift
example: 1000 >> 2 (result = 0010)
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::assignXor ( const __int64  val  )  [inline]

this->value ^= val (bitwise exclusive OR)

example: 1001 ^ 0011 = 1010 (same bits are getting 0, different bits becomes 1)

Returns:
Reference to this object containing the result of the operation
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::bitwiseNot (  )  [inline]

result = ~this->value (bitwise NOT)

Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::invertSign (  )  const [inline]

changes the sign of this value and stores the result in a new siv-object

returns -( this->value )

Returns:
A siv-object containing the value
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
Hint:
This object remains unchanged (method is const)
See also:
assignInv(), inv(), assignAbs(), abs(), assignNeg(), neg()
siv siv::negative (  )  const [inline]

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

siv-object = -abs( this->value )

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

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

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

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

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

returns this->value & val in a siv-object ( value & exp )

Parameters:
val the bit-mask
Returns:
A siv object with the result of the operation
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::operator&= ( const __int64  val  )  [inline]

this->value &= val (bitwise AND)

Parameters:
val the bit-mask
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::operator* ( const siv multiplicand  )  const [inline]

returns this->value * multiplicand in a siv object

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

returns this->value * multiplicand in a siv object

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

returns this->value + addend in a siv object

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

returns this->value + addend in a siv object

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

returns this->value - subtrahend in a siv object

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

returns this->value - subtrahend in a siv object

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

returns this->value / denominator in a siv object

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

returns this->value / denominator in a siv object

Parameters:
denominator the value to be divided from this->value
Returns:
A siv containing the result of the operation.
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignDiv()
siv siv::operator<< ( const int  cnt  )  [inline]

result = this->value << cnt (bitwise shift left)

Parameters:
cnt number of bits to be shift
example: 0001 << 2 (result = 0100)
Returns:
A siv object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::operator<<= ( const int  cnt  )  [inline]

this->value <<= cnt (bitwise shift left and reasign)

Parameters:
cnt number of bits to be shift
example: 0001 << 2 (result = 0100)
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::operator= ( const double  val  )  [inline]

assign operator to copy a 64-bit floating point value

Parameters:
val the 64-bit float value to be copied into this siv object
Returns:
Reference to this siv object
See also:
assignCopy(), operator =
siv siv::operator>> ( const int  cnt  )  [inline]

result = this->value >> cnt (bitwise shift left)

Parameters:
cnt number of bits to be shift
example: 1000 >> 2 (result = 0010)
Returns:
A siv object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::operator>>= ( const int  cnt  )  [inline]

this->value >>= cnt (bitwise shift right and reasign)

Parameters:
cnt number of bits to be shift
example: 1000 >> 2 (result = 0010)
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::operator^ ( const __int64  val  )  const [inline]

returns this->value ^ val in a siv-object (bitwise exclusive OR)

Parameters:
val the bit-mask
Returns:
A siv object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::operator^= ( const __int64  val  )  [inline]

this->value ^= val (bitwise exclusive OR)

Parameters:
val the bit-mask
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::operator| ( const __int64  val  )  const [inline]

returns this->value | val in a siv-object (bitwise OR)

Parameters:
val the bit-mask
Returns:
A siv object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::operator|= ( const __int64  val  )  [inline]

this->value |= val (bitwise OR)

Parameters:
val the bit-mask
Returns:
Reference to this object containing the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv& siv::operator~ (  )  [inline]

result = ~this->value (bitwise NOT)

Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::or ( const __int64  val  )  const [inline]

result = this->value | val (bitwise OR)

Parameters:
val the bit-mask
Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::positive (  )  const [inline]

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

siv-object = abs( this->value )

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

calculates this->value = this->value pow exp

Parameters:
exp the exponent
Returns:
Reference to this object containing the result of the operation
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignRoot(), root(), assignSqrt(), sqrt(),
assignPow(), pow(),
void siv::printBitpat ( FILE *  file = 0  )  const [inline]

prints the bitpattern of the signed integer 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:
siv myValue = 123456;
myValue.printBitpat();
Result:
1e240
siv siv::reciproc (  )  const [inline]

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

calculates the reciproc value of this->value

Returns:
A siv object containing the result of the operation.
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
See also:
assignReciproc()
siv siv::rotLeft ( const int  cnt  )  const [inline]

result = this->value rotLeft cnt (bitwise rotate left)

Parameters:
cnt number of bits to be rotated
example: 1001 rotLeft 2 (result = 0110)
Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::rotRight ( const int  cnt  )  const [inline]

result = this->value rotRight cnt (bitwise rotate right)

Parameters:
cnt number of bits to be rotated
example: 0001 >> 2 (result = 0100)
Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::shiftLeft ( const int  cnt  )  const [inline]

result = this->value << cnt (bitwise shift left)

Parameters:
cnt number of bits to be shift
example: 0001 << 2 (result = 0100)
Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::shiftRight ( const int  cnt  )  const [inline]

result = this->value >> cnt (bitwise shift right)

Parameters:
cnt number of bits to be shift
example: 1000 >> 2 (result = 0010)
Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),
siv siv::sqrt (  )  const [inline]

returns sqrt this->value in a siv object

Returns:
A siv object with the result of this operation.
The result will be in range of [ LLONG_MIN .. LLONG_MAX ]
Hint:

If this->value is negative assignSqrt calculates
this->value = -sqrt | this->value |
and sets the status bits negRadicand and negative
See also:
assignRoot(), root(), assignSqrt(), sqrt(),
assignPow(), pow(),
virtual __int64 siv::stringToValue ( const char *  stringValue  )  [inline, virtual]

converts stringValue to a number of type numType

Parameters:
stringValue pointer to the first character in the string where the value begins
Returns:
the value in numType format
Hint:
This method is pure virtual.
In case of errors the implementation must set bms.
siv siv::xor ( const __int64  val  )  const [inline]

result = this->value ^ val (bitwise exclusive OR)

Parameters:
val the bit-mask
Returns:
A siv-object with the result of the operation
See also:
assignAnd(), and(), assignOr(), or(),
assignNot(), not(), assignXor(), xor(),
assignShiftLeft(), shiftLeft(), assignShiftRight(), shiftRight(),
assignRotLeft(), rotLeft(), assignRotRight(), rotRight(),
operator & (), operator &= (), operator | (), operator |= (),
operator ^ (), operator ^= (), operator << (), operator <<= (),
operator >> (), operator >>= (),

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