BigFloat Class - Properties and Methods

---------------------------------------------------------------------------------------
Number Property

Description:
Sets or returns a variant containing the number represented by the object.  Read/write.

Remarks:
This property only accepts and returns base 10 numbers.  To set the object to a number 
from a different base (i.e. Hex) use the LoadBase method.

---------------------------------------------------------------------------------------
IsFloat Property

Description:
Returns a boolean indicating whether or not the number represented by the object is a 
floating point number.  Read only.

---------------------------------------------------------------------------------------
Sign Property

Description:
Returns an integer signed the same as the number represented by the object.  Read only.

Remarks:
This property returns 1 if the number is positive, -1 if it is negative, and 0 if it is zero.  It 
is functionally identical to the Sgn function.

---------------------------------------------------------------------------------------
Add Method

Description:
Returns a string containing the sum of the number represented by the object and the 
number passed.

Syntax:
object.Add(vNumber)

Remarks:
vNumber can contain any expression that can be set to the number property.

---------------------------------------------------------------------------------------
Subtract Method

Description:
Returns a string containing the number represented by the object minus the number 
passed.

Syntax:
object.Subtract(vNumber)

Remarks:
vNumber can contain any expression that can be set to the number property.

---------------------------------------------------------------------------------------
Multiply Method

Description:
Returns a string containing the number represented by the object multiplied by the 
number passed.

Syntax:
object.Multiply(vNumber)

Remarks:
vNumber can contain any expression that can be set to the number property.

---------------------------------------------------------------------------------------
Divide Method

Description:
Returns a string containing the number represented by the object divided by the number 
passed.

Syntax:
object.Divide(vNumber, [iSigDigits])

Remarks:
vNumber can contain any expression that can be set to the number property.  iSigDigits is 
an optional value specifying the maximum number of decimal places to carry the result 
to.  Any zeros past the number of specified in iSigDigits are truncated.  The default value 
is 10.

---------------------------------------------------------------------------------------
IntDivide Method

Description:
Returns a string containing the number represented by the object integer divided by the 
number passed.

Syntax:
object.IntDivide(vNumber)

Remarks:
vNumber can contain any expression that can be set to the number property.  This method 
functions exactly the same as the \ operator.  That is, both numbers are rounded before 
the division is performed, and the result is truncated at the decimal point.

---------------------------------------------------------------------------------------
Modulus Method

Description:
Returns a string containing the modulus of the  represented by the object divided by the 
number passed.

Syntax:
object.Modulus(vNumber)

Remarks:
vNumber can contain any expression that can be set to the number property.  This method 
performs an identical function to the Mod operator.  Both numbers are rounded before the 
division is performed, and the remainder of the integer division is returned.

---------------------------------------------------------------------------------------
RoundTo Method

Description:
Rounds the number represented by the object to the specified number of decimal places.

Syntax:
object.RoundTo([iDecPlaces])

Remarks:
If the optional iDecPlaces is not passed, an integer value is returned.  If iDecPlaces is 
negative, the number is rounded to the left of the decimal.  For example, 1234 rounded to 
-2 decimal places would return 1200. 

---------------------------------------------------------------------------------------
Reciprocal Method

Description:
Returns a string containing the reciprocal of the number represented by the object.

Syntax:
object.Reciprocal([iSigDigits])

Remarks:
iSigDigits is an optional argument specifying the number of decimals to return.  The 
default number of significant digits is 10.  Because a reciprocal is 1/x, the return will 
always be a floating point number less than 1.

---------------------------------------------------------------------------------------
Power Method

Description:
Returns a string containing the number represented by the object raised to the power of 
the number passed.

Syntax:
object.Power(iNumber, [iPrecision])

Remarks:
iPrecision is an optional argument specifying the number of decimal places to carry the 
result to.  If this is not specified, the default value is 10.  The method will perform the 
operation x ^ iNumber, where iNumber is any positive or negative integer.  Note that 
raising numbers to large exponents may take a considerable amount of time.

---------------------------------------------------------------------------------------
Absolute Method

Description:
Returns a string containing the absolute (unsigned) value of the number represented by 
the object.

Syntax:
object.Absolute

---------------------------------------------------------------------------------------
GreaterThan Method

Description:
Returns a boolean value indicating whether or not the number represented by the object is 
greater than the passed number.

Syntax:
object.GreaterThan(vNumber)

Remarks:
vNumber can contain any expression that can be set to the number property.

---------------------------------------------------------------------------------------
LessThan Method

Description:
Returns a boolean value indicating whether or not the number represented by the object is 
less than the passed number.

Syntax:
object.LessThan(vNumber)

Remarks:
vNumber can contain any expression that can be set to the number property.

---------------------------------------------------------------------------------------
AsBinary Method

Description:
Returns a string containing the signed value of the number represented by the object in 
binary notation.

Syntax:
object.AsBinary

Remarks:
This method rounds the number to an integer before performing the conversion.

---------------------------------------------------------------------------------------
AsOctal Method

Description:
Returns a string containing the signed value of the number represented by the object in 
octal notation.

Syntax:
object.AsOctal

Remarks:
This method rounds the number to an integer before performing the conversion.

---------------------------------------------------------------------------------------
AsHex Method

Description:
Returns a string containing the signed value of the number represented by the object in 
hexadecimal notation.

Syntax:
object.AsHex

Remarks:
This method rounds the number to an integer before performing the conversion.

---------------------------------------------------------------------------------------
AsBase Method

Description:
Returns a string containing the signed value of the number represented by the object in 
the notation of the specified base.

Syntax:
object.AsBase(vNumber)

Remarks:
vNumber is the base to convert the number to, and must be in the range of 2 to 35.  This 
method rounds the number to an integer before performing the conversion.

---------------------------------------------------------------------------------------
LoadBase Method

Description:
Sets the value of the object to the number passed, converting it from the specified base.

Syntax:
object.LoadBase(vNumber, vBase)

Remarks:
vNumber can contain any expression that can be set to the number property.  vBase is the 
base to convert the number from, and must be in the range of 2 to 35.  This method 
truncates the passed number at the decimal point before performing the conversion.

---------------------------------------------------------------------------------------
ConvertsTo Method

Description:
Returns a boolean indicating whether or not the value returned  by the object's Number 
property can be converted into specified type. 

Syntax:
object.ConvertsTo(sType)

Remarks:
sType is the name of the type to test the number against.  For example, if "Integer" is 
passed the method will return true if the number can be converted an Integer. 

Example:

Dim oNum As New BigFloat, iTemp As Integer

If oNum.ConvertsTo(TypeName(iTemp)) Then
    iTemp = oNum.Number		'This assignment will not overflow.
End If 

---------------------------------------------------------------------------------------
BitAnd Method

Description:
Performs a bitwise And operation on the number represented by the object and the 
number passed, and returns a string containing the result.

Syntax:
object.BitAnd(vNumber, [bByteWise], [bAsBinary])

Remarks:
vNumber can contain any expression that can be set to the number property.  Both 
numbers are rounded at the decimal and made to match in length before the operation is 
performed.  bByteWise is an optional boolean specifying whether or not to operate on the 
number represented by bytes (8 digit binary numbers).  For example if bByteWise is false, 
the operation 31 And 51 would be evaluated as 011111 And 110011.  If bBytewise is true, 
the same operation would performed on 00011111 and 00110011.  If the optional 
bAsBinary argument is set to true, the return will be in binary notation, otherwise it will 
be in base 10.  Finally, the operation is also performed on the number's signs with 1 
equal to negative and the returned value is signed.

---------------------------------------------------------------------------------------
BitEqv Method

Description:
Performs a bitwise equivalence operation on the number represented by the object and 
the number passed, and returns a string containing the result.

Syntax:
object.BitEqv(vNumber, [bByteWise], [bAsBinary])

Remarks:
vNumber can contain any expression that can be set to the number property.  See the 
remarks for the BitAnd method for descriptions of the optional parameters and how the 
operation is performed.

---------------------------------------------------------------------------------------
BitImp Method

Description:
Performs a bitwise implication operation on the number represented by the object and the 
number passed, and returns a string containing the result.

Syntax:
object.BitImp(vNumber, [bByteWise], [bAsBinary])

Remarks:
vNumber can contain any expression that can be set to the number property.  See the 
remarks for the BitAnd method for descriptions of the optional parameters and how the 
operation is performed.

---------------------------------------------------------------------------------------
BitOr Method

Description:
Performs a bitwise Or operation on the number represented by the object and the number 
passed, and returns a string containing the result.

Syntax:
object.BitOr(vNumber, [bByteWise], [bAsBinary])

Remarks:
vNumber can contain any expression that can be set to the number property.  See the 
remarks for the BitAnd method for descriptions of the optional parameters and how the 
operation is performed.

---------------------------------------------------------------------------------------
BitXor Method

Description:
Performs a bitwise Xor operation on the number represented by the object and the 
number passed, and returns a string containing the result.

Syntax:
object.BitXor(vNumber, [bByteWise], [bAsBinary])

Remarks:
vNumber can contain any expression that can be set to the number property.  See the 
remarks for the BitAnd method for descriptions of the optional parameters and how the 
operation is performed.

---------------------------------------------------------------------------------------
BitNot Method

Description:
Performs a bitwise Not operation on the number represented by the object and returns a 
string containing the result.

Syntax:
object.BitNot([bByteWise], [bAsBinary])

Remarks:
See the remarks for the BitAnd method for descriptions of the optional parameters and 
how the operation is performed.  BitNot does not take a number as an argument.

---------------------------------------------------------------------------------------
Formated Method

Description:
Returns a string containing the number represented by the object in the specified base 
with added separators for some bases.

Syntax:
object.Formated([vBase], [iPrecision])

Remarks:
vBase is an optional argument specifying the base to use to represent the number.  If 
vBase is not specified, 10 is used by default.  If base 10 is specified, thousands separators 
are added to the left of the decimal point.  For binary, the returned number is separated 
into bytes by spaces.  For octal, the return number is separated into groups of 4 by spaces, 
and groups of 2 if the base is hexadecimal.  For bases other than 10, the number is 
rounded to an integer before conversion.  For base 10, the number is rounded to the 
number of decimal places specified in the optional parameter iPrecision.  If iPrecision is 
not specified, the number rounded to an integer.  The iPrecision parameter is ignored for 
bases other than 10.

Example:

Dim oNum As BigFloat

Set oNum = New BigFloat
oNum.Number = 12345.6789
Debug.Print (oNum.Formated)         'Returns 12,346
Debug.Print (oNum.Formated(, 3))    'Returns 12,345.679
Debug.Print (oNum.Formated(2))      'Returns 00110000 00111010
Debug.Print (oNum.Formated(8))      'Returns 0003 0072
Debug.Print (oNum.Formated(16))     'Returns 30 3A
Debug.Print (oNum.Formated(7))      'Returns 50665
Set oNum = Nothing
