Platforms to show: All Mac Windows Linux Cross-Platform

BiggerNumberMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Math MBS DataTypes Plugin 20.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: The class for a big number.
Example:
// speed of light in m/s
Dim SpeedOfLight As New BiggerNumberMBS("299792458")

// seconds per day
Dim SecondsPerDay As New BiggerNumberMBS(24 * 3600)

Dim DaysPerYear As New BiggerNumberMBS(365.25)

Dim LightYear As BiggerNumberMBS = SpeedOfLight * DaysPerYear * SecondsPerDay
MsgBox LightYear.StringValue+" meter per light year"

// 9.460.730.472.580.800 matches number from Wikipedia


Dim AgeOfUniversum As New BiggerNumberMBS(13810000000)

Dim MaxDistance As BiggerNumberMBS = LightYear * AgeOfUniversum

MsgBox MaxDistance.GetStringValue(10, False, 100, 3, True)+" meter maximum"
Notes:
This is floating point number with 320 bits in BigNumber and 2560 bits in BiggerNumber class.
Precision is about 77 digits dot for the smaller one and 617 for the bigger one.
So use first for speed and second for precision.

So if you want to store currency or other values where rounding should not happen, better store values multiplied, e.g. in cents.

Compared to normal double values, you have 5 times the bits.
And we check for math errors and raise exceptions if something goes wrong.

See LargeNumberMBS for a 4128 bit integer number, about 1200 digits in length.

Feedback, Comments & Corrections

  • 15 properties
  • 51 methods
  • 55 shared methods
    • shared method Abs(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ACos(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ACosh(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ACot(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ACoth(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ASin(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ASinh(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ATan(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method ATanh(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Cos(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Cosh(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Cot(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Coth(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method DegToDeg(d as BiggerNumberMBS, m as BiggerNumberMBS, s as BiggerNumberMBS) as BiggerNumberMBS
    • shared method DegToGrad(d as BiggerNumberMBS, m as BiggerNumberMBS, s as BiggerNumberMBS) as BiggerNumberMBS
    • shared method DegToGrad(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method DegToRad(d as BiggerNumberMBS, m as BiggerNumberMBS, s as BiggerNumberMBS) as BiggerNumberMBS
    • shared method DegToRad(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method E as BiggerNumberMBS
    • shared method Exp(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method GradToDeg(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method GradToRad(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method HalfPi as BiggerNumberMBS
    • shared method LibTypeStr as String
    • shared method Ln(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Ln10 as BiggerNumberMBS
    • shared method Ln2 as BiggerNumberMBS
    • shared method Log(value as BiggerNumberMBS, base as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Max as BiggerNumberMBS
    • shared method Min as BiggerNumberMBS
    • shared method Nan as BiggerNumberMBS
    • shared method NumberWithCurrency(value as Currency) as BiggerNumberMBS
    • shared method NumberWithDouble(value as Double) as BiggerNumberMBS
    • shared method NumberWithInt32(value as Int32) as BiggerNumberMBS
    • shared method NumberWithInt64(value as Int64) as BiggerNumberMBS
    • shared method NumberWithInteger(value as Integer) as BiggerNumberMBS
    • shared method NumberWithSingle(value as single) as BiggerNumberMBS
    • shared method NumberWithString(value as String) as BiggerNumberMBS
    • shared method NumberWithUInt32(value as UInt32) as BiggerNumberMBS
    • shared method NumberWithUInt64(value as UInt64) as BiggerNumberMBS
    • shared method NumberWithUInteger(value as UInteger) as BiggerNumberMBS
    • shared method NumberWithVariant(value as Variant) as BiggerNumberMBS
    • shared method One as BiggerNumberMBS
    • shared method Pi as BiggerNumberMBS
    • shared method RadToDeg(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method RadToGrad(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Rand as BiggerNumberMBS
    • shared method Root(value as BiggerNumberMBS, index as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Sgn(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Sin(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Sinh(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Tan(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method Tanh(value as BiggerNumberMBS) as BiggerNumberMBS
    • shared method TwoPi as BiggerNumberMBS
    • shared method Zero as BiggerNumberMBS

This class has no sub classes.

Blog Entries

Xojo Developer Magazine

Videos


The items on this page are in the following plugins: MBS DataTypes Plugin.


BevelButton   -   BigNumberErrorExceptionMBS

The biggest plugin in space...




Links
MBS FileMaker tutorial videos

Start Chat