Platforms to show: All Mac Windows Linux Cross-Platform

Back to LargeNumberMBS class.

Previous items

LargeNumberMBS.Operator_Subtract(other as LargeNumberMBS) as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Subtracts other number and returns result.
Example
Dim l As LargeNumberMBS = LargeNumberMBS.NumberWithInteger(20)
Dim o As LargeNumberMBS = LargeNumberMBS.NumberWithInteger(10)

Dim r As LargeNumberMBS = l-o
Dim s As LargeNumberMBS = o-l

MsgBox r.StringValue+" "+s.StringValue

LargeNumberMBS.Operator_SubtractRight(other as LargeNumberMBS) as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Subtracts other number and returns result.
Example
Dim o As New LargeNumberMBS(5)

// "10" is auto converted to LargeNumberMBS and Operator_SubtractRight is called
Dim r As LargeNumberMBS = "10" - o

MsgBox r.StringValue

LargeNumberMBS.RightShift(bits as integer) as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Shifts value to right by given number of bits.

Bits must be <= 32.

LargeNumberMBS.SetStringValue(Text As String, Base as Integer, byref AfterText as String, Byref ValueRead as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 24.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets number from text.

Returns the text after the given text following the number in AfterText parameter.
Sets ValueRead if a value was read.

LargeNumberMBS.SetZero

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets number to zero.
Example
Dim l1 As LargeNumberMBS = LargeNumberMBS.NumberWithInt32(12345)
MsgBox l1.StringValue

// set to zero
l1.SetZero
MsgBox l1.StringValue

LargeNumberMBS.SqrMod(Modulo as LargeNumberMBS) as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Multiply with itself and modulo.
Example
Dim o As New LargeNumberMBS(90)
Dim m As New LargeNumberMBS(255)
Dim r As LargeNumberMBS = o.SqrMod(m)

MsgBox r.StringValue // shows 195 = (90 * 90) mod 255

LargeNumberMBS.sqrt as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Calculates square root of value.
Example
Dim l As New LargeNumberMBS(1234567890123456)

// let's multiple first and then
Dim q As LargeNumberMBS = l * l
Dim root As LargeNumberMBS = q.Sqrt

If l = root Then
Break // okay
Else
Break // failed
End If

Get nearly square root of a. The answer will be a >= ret^2.

LargeNumberMBS.Square as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Calculates square of current value.

Return x^2.

LargeNumberMBS.SubMod(v as LargeNumberMBS, Modulo as LargeNumberMBS) as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Subtraction with modulo.
Example
Dim v As New LargeNumberMBS(100)
Dim o As New LargeNumberMBS(200)
Dim n As New LargeNumberMBS(&hFF)

Dim r As LargeNumberMBS = v.SubMod(o, n)

MsgBox r.StringValue // shows 155 = (100-200) mod 255

// -100 is too small, so 255 is added to bring to range.

LargeNumberMBS.Subtract(other as LargeNumberMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Subtracts other number.

See also:

LargeNumberMBS.Subtract(other as LargeNumberMBS) as LargeNumberMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Math MBS DataTypes Plugin 19.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Subtracts other number and returns result.

See also:

Previous items

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


The biggest plugin in space...