MfBigInt

Namespace ›› System ››
Parent Previous Next

MfBigInt Class

(Inherits from MfObject)

Represents Big Integer object

Links

Fields, Properties, Methods, Remarks, Example

Constructors


Name

Description

Constructor([val, retunAsObj, readonly])

Initializes a new instance of the MfBigInt class optionally setting the Value property, ReturnAsObject property and the ReadOnly property.

Properties


Name

Description

ReadOnly

Gets the if the class will allow the underlying value to be altered after the constructor has been called.

ReturnAsObject

Gets or sets the if the MfBigInt class will return objects as their return value for various functions. Inherited from MfPrimitive

Value

Gets or sets the value associated with the this instance.

Methods


Name

Description

Add(value)

Adds value to current instance of MfBigInt.

BitShiftLeft(value)

Performs left shift operation current instance bits by value amount.

BitShiftRight(value)

Performs right shift operation current instance bits by value amount.

Clone()

Clones the current instance an return  a new instance with the same values.

CompareTo(obj)

Compares this instance to a specified MfBigInt instance. Overrides MfObject.CompareTo()

Divide(value)

Divides the current instance of MfBigInt by the divisor value and returns remainder as instance of MfBigInt

DivRem(dividend, divisor, remainder)

Calculates the quotient of two MfBigInt signed integers and also returns the remainder in an output parameter.

Equals(value)

Gets if this instance Value is the same as the obj instance.Value. Overrides MfObject.Equals()

GetHashCode()

Gets A hash code for the current MfBigInt instance. Overrides MfObject.GetHashCode()

GetType()

Gets the Type for the for the Class .Inherited from MfObject.

GetTypeCode()

Get an enumeration value of MfTypeCode the represents MfBigInt Type Code.

GreaterThen(value)

Compares the current MfBigInt object to value and returns an indication of their relative values.

GreaterThenOrEqual(value)

Compares the current MfBigInt object to value and returns an indication of their relative values.

LessThen(value)

Compares the current MfBigInt object to value and returns an indication of their relative values.

LessThenOrEqual(value)

Compares the current MfBigInt object to value and returns an indication of their relative values.

Multiply(value)

Multiplies the current instance of MfBigInt by the value.

Is(type)

Gets if current instance of object is of the same type. Inherited from MfObject. Inherited from MfObject.

IsInstance()

Get if the current class is an instance. Inherited from MfObject.

MemberwiseClone()

Creates a shallow copy of the current MfObject instance. Inherited from MfObject.

Parse(s)

Converts the s representation of a number to its MfBigInt equivalent

Parse(s, base)

Converts the s representation of a number to its MfBigInt equivalent. Uses base value to decode s.

Subtract(value)

Subtracts MfBigInt value from current instance of MfBigInt.

ToString()

Gets a string representation of the MfBigInt instance.

ToString(base)

Gets a string representation of the MfBigInt instance encode by the value of base.

Remarks

MfBigInt is capable of working with integer value an any size and is only limited by the resources available on the current computer it is running on. This class can output from base 2 to base 95 by using the ToString(base) method and can read from base 2 to base 95 by using the Parse(s, base) method.

The Value property will always output a base 10 var.

Internally MfBigInt uses an array of integers that grows as needed to store it value. This gives the class the ability to store very large integer value.

Since

Version 0.4

Example

i := new MfBigInt("88839834534058347978797", true) ; create new MfBigInt and set it RetrunAsObject to value to true

iNew := new MfBigInt("5345354")
r := i.Divide(iNew)
MsgBox % MfString.Format("Result:'{0}', Remainder:'{1}'", r.Value, i.Value) ; Result:'16620009551108934', Remainder:'3186161'

i := new MfBigInt(0, true) ; create new MfInt64 and set it RetrunAsObject to value to true
i.Add(2)
iNew := new MfBigInt("5785834585805893405858034584509789576")
MsgBox % i.Add(iNew).Value                                      ; displays 5785834585805893405858034584509789578
MsgBox % i.Add("-053405829305806934085940685").Value            ; displays 5785834585805893405858034584509767301
MsgBox % i.Add(258897).Add(new MfInt64(MfInt64.MaxValue)).Value ; displays 5785834585805893405858034584510026198

bigI := MfBigInt.Parse("Kpsio", 88) ; base 88
MsgBox % bigI.Value ; 1234567890