Platforms to show: All Mac Windows Linux Cross-Platform
BigNumberMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Math | MBS DataTypes Plugin | 16.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
- 15 properties
- property CurrencyValue as Currency
- property DataExponent as MemoryBlock
- property DataFlags as Integer
- property DataMantissa as MemoryBlock
- property DoubleValue as Double
- property Int64Value as Int64
- property IntegerValue as Integer
- property IsInteger as Boolean
- property IsNan as Boolean
- property IsNegative as Boolean
- property IsZero as Boolean
- property StringValue as String
- property UInt64Value as UInt64
- property VariantValue as Variant
- property StringValue(Base as Integer) as String
- 54 methods
- method Abs as BigNumberMBS
- method Add(other as BigNumberMBS, round as boolean = true) as BigNumberMBS
- method BitAnd(other as BigNumberMBS) as BigNumberMBS
- method BitOr(other as BigNumberMBS) as BigNumberMBS
- method BitXOr(other as BigNumberMBS) as BigNumberMBS
- method Ceil as BigNumberMBS
- method Constructor
- method Constructor(other as BigNumberMBS)
- method Constructor(value as Currency)
- method Constructor(value as Double)
- method Constructor(value as Int32)
- method Constructor(value as Int64)
- method Constructor(value as Single)
- method Constructor(value as String)
- method Constructor(value as UInt32)
- method Constructor(value as UInt64)
- method Divide(other as BigNumberMBS, round as boolean = true) as BigNumberMBS
- method Equals(other as BigNumberMBS) as Boolean
- method Floor as BigNumberMBS
- method Frac as BigNumberMBS
- method GetStringValue(Base as Integer = 10, scientific as boolean = false, scientificFrom as Integer = 15, round as Integer = -1, TrimZeros as Boolean = true, comma as String = ".") as String
- method GetStringValue(Conversion as BigNumberConversionMBS) as String
- method Modulate(other as BigNumberMBS) as BigNumberMBS
- method Modulate2 as Integer
- method Multiply(other as BigNumberMBS, round as boolean = true) as BigNumberMBS
- method Multiply(value as Integer) as BigNumberMBS
- method Multiply(value as UInt32) as BigNumberMBS
- method Negate as BigNumberMBS
- method Operator_Add(other as BigNumberMBS) as BigNumberMBS
- method Operator_AddRight(other as BigNumberMBS) as BigNumberMBS
- method Operator_Compare(other as BigNumberMBS) as Integer
- method Operator_Convert as String
- method Operator_Convert(value as String)
- method Operator_Divide(other as BigNumberMBS) as BigNumberMBS
- method Operator_DivideRight(other as BigNumberMBS) as BigNumberMBS
- method Operator_IntegerDivide(other as BigNumberMBS) as BigNumberMBS
- method Operator_IntegerDivideRight(other as BigNumberMBS) as BigNumberMBS
- method Operator_Modulo(other as BigNumberMBS) as BigNumberMBS
- method Operator_ModuloRight(other as BigNumberMBS) as BigNumberMBS
- method Operator_Multiply(other as BigNumberMBS) as BigNumberMBS
- method Operator_MultiplyRight(other as BigNumberMBS) as BigNumberMBS
- method Operator_Negate as BigNumberMBS
- method Operator_Power(other as BigNumberMBS) as BigNumberMBS
- method Operator_PowerRight(other as BigNumberMBS) as BigNumberMBS
- method Operator_Subtract(other as BigNumberMBS) as BigNumberMBS
- method Operator_SubtractRight(other as BigNumberMBS) as BigNumberMBS
- method Pow(other as BigNumberMBS) as BigNumberMBS
- method Round as BigNumberMBS
- method SetStringValue(Text As String, Base as Integer, byref AfterText as String, Byref ValueRead as boolean)
- method SetStringValue(Text As String, Conversion as BigNumberConversionMBS)
- method SetStringValue(Text As String, Conversion as BigNumberConversionMBS, byref AfterText as String, Byref ValueRead as boolean)
- method SkipFraction as BigNumberMBS
- method Sqrt as BigNumberMBS
- method Subtract(other as BigNumberMBS, round as boolean = true) as BigNumberMBS
- 55 shared methods
- shared method Abs(value as BigNumberMBS) as BigNumberMBS
- shared method ACos(value as BigNumberMBS) as BigNumberMBS
- shared method ACosh(value as BigNumberMBS) as BigNumberMBS
- shared method ACot(value as BigNumberMBS) as BigNumberMBS
- shared method ACoth(value as BigNumberMBS) as BigNumberMBS
- shared method ASin(value as BigNumberMBS) as BigNumberMBS
- shared method ASinh(value as BigNumberMBS) as BigNumberMBS
- shared method ATan(value as BigNumberMBS) as BigNumberMBS
- shared method ATanh(value as BigNumberMBS) as BigNumberMBS
- shared method Cos(value as BigNumberMBS) as BigNumberMBS
- shared method Cosh(value as BigNumberMBS) as BigNumberMBS
- shared method Cot(value as BigNumberMBS) as BigNumberMBS
- shared method Coth(value as BigNumberMBS) as BigNumberMBS
- shared method DegToDeg(d as BigNumberMBS, m as BigNumberMBS, s as BigNumberMBS) as BigNumberMBS
- shared method DegToGrad(d as BigNumberMBS, m as BigNumberMBS, s as BigNumberMBS) as BigNumberMBS
- shared method DegToGrad(value as BigNumberMBS) as BigNumberMBS
- shared method DegToRad(d as BigNumberMBS, m as BigNumberMBS, s as BigNumberMBS) as BigNumberMBS
- shared method DegToRad(value as BigNumberMBS) as BigNumberMBS
- shared method E as BigNumberMBS
- shared method Exp(value as BigNumberMBS) as BigNumberMBS
- shared method GradToDeg(value as BigNumberMBS) as BigNumberMBS
- shared method GradToRad(value as BigNumberMBS) as BigNumberMBS
- shared method HalfPi as BigNumberMBS
- shared method LibTypeStr as String
- shared method Ln(value as BigNumberMBS) as BigNumberMBS
- shared method Ln10 as BigNumberMBS
- shared method Ln2 as BigNumberMBS
- shared method Log(value as BigNumberMBS, base as BigNumberMBS) as BigNumberMBS
- shared method Max as BigNumberMBS
- shared method Min as BigNumberMBS
- shared method Nan as BigNumberMBS
- shared method NumberWithCurrency(value as Currency) as BigNumberMBS
- shared method NumberWithDouble(value as Double) as BigNumberMBS
- shared method NumberWithInt32(value as Int32) as BigNumberMBS
- shared method NumberWithInt64(value as Int64) as BigNumberMBS
- shared method NumberWithInteger(value as Integer) as BigNumberMBS
- shared method NumberWithSingle(value as single) as BigNumberMBS
- shared method NumberWithString(value as String) as BigNumberMBS
- shared method NumberWithUInt32(value as UInt32) as BigNumberMBS
- shared method NumberWithUInt64(value as UInt64) as BigNumberMBS
- shared method NumberWithUInteger(value as UInteger) as BigNumberMBS
- shared method NumberWithVariant(value as Variant) as BigNumberMBS
- shared method One as BigNumberMBS
- shared method Pi as BigNumberMBS
- shared method RadToDeg(value as BigNumberMBS) as BigNumberMBS
- shared method RadToGrad(value as BigNumberMBS) as BigNumberMBS
- shared method Rand as BigNumberMBS
- shared method Root(value as BigNumberMBS, index as BigNumberMBS) as BigNumberMBS
- shared method Sgn(value as BigNumberMBS) as BigNumberMBS
- shared method Sin(value as BigNumberMBS) as BigNumberMBS
- shared method Sinh(value as BigNumberMBS) as BigNumberMBS
- shared method Tan(value as BigNumberMBS) as BigNumberMBS
- shared method Tanh(value as BigNumberMBS) as BigNumberMBS
- shared method TwoPi as BigNumberMBS
- shared method Zero as BigNumberMBS
This class has no sub classes.
Some examples using this class:
Blog Entries
- News from the MBS Xojo Plugins Version 24.0
- MonkeyBread Software Releases the MBS Xojo Plugins in version 24.0
- MBS Xojo Plugins, version 23.6pr1
- News from the MBS Xojo Plugins Version 21.1
- Video about MBS Xojo Plugins 21.1
- MonkeyBread Software Releases the MBS Xojo Plugins in version 21.1
- MonkeyBread Software Releases the MBS Xojo Plugins in version 19.1
- Large integer numbers in Xojo
- MBS Xojo / Real Studio plug-ins in version 16.5
- Big numbers for Xojo
Xojo Developer Magazine
- 22.3, page 10: News
- 22.2, page 9: News
- 21.3, pages 68 to 69: Large, Big, and Bigger Numbers, Working with giant numbers by Stefanie Juchmes
- 19.3, page 44: Xojo Time and Space—Into a Programming Black Hole, How converting durations and distances into human-readable form reveals a 32-bit problem at the heart of Xojo's 64-bit math module by Markus Winter
- 19.3, page 10: News
- 17.6, page 65: Big Numbers and Large Numbers, How you can use the BigNumberMBS and LargeNumberMBS class in Xojo by Stefanie Juchmes
- 17.6, pages 61 to 63: Big Numbers and Large Numbers, How you can use the BigNumberMBS and LargeNumberMBS class in Xojo by Stefanie Juchmes
- 17.5, page 33: What's New in the MBS Plugins, With the Plugins growing every year, here are new capabilities you may have missed by Stefanie Juchmes
- 16.1, page 28: MBS London Conference 2017, Marc visits England by Richard Duke, Mediatec
- 15.1, page 8: News
Videos
- MBS Xojo Plugins 21.1
- Presentation from London conference about MBS Plugins.
- Presentation from Xojo Developer Conference 2019 in Miami.
Release notes
- Version 24.0
- Added new GetStringValue and SetStringValue methods to BigNumberMBS class.
- Version 21.1
- Added 30 new trigonometry functions for BigNumberMBS class.
- Version 20.5
- Added code to detect if variant is unsigned, so we can handle UInt32/UInt64 correctly in BigNumberMBS, JavaScriptEngineMBS, SQLPreparedStatementMBS and SQLCommandMBS, SQLValueMBS, and JSONMBS classes and in CFDictionaryMBS/NSDictionary conversion.
- Version 19.2
- Fixed problem with BigNumberMBS raising RuntimeException instead of BigNumberErrorExceptionMBS.
- Version 18.2
- Fixed BigNumberMBS.CurrencyValue property.
- Version 18.1
- Fixed problem with BigNumberMBS to currency conversion. Now rounding.
The items on this page are in the following plugins: MBS DataTypes Plugin.
BigNumberErrorExceptionMBS - BlockMBS