Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

DoubleToInt64MBS(value as Double) as Int64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Math MBS Util Plugin 12.1 Yes Yes Yes Yes No
Function: Converts a double value to Int64.

Feedback, Comments & Corrections

DoubleToUInt64MBS(value as Double) as UInt64
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Math MBS Util Plugin 11.1 Yes Yes Yes Yes No
Function: Converts a double value to UInt64 correctly.
Example:
// set d to a very high UInt64 value
dim d as Double = pow(256.0,8.0) - 10000

// RB will convert to Int64 here! so number is cut to 9... instead of 18...
dim u1 as UInt64 = d

// plugin does it right
dim u2 as UInt64 = DoubleToUInt64MBS(d)

MsgBox str(u1)+" "+str(u2)
Notes: Real Studio converts UInt64 to Double with an intermediate Int64 which breaks big numbers. This function does it correctly.

Feedback, Comments & Corrections

Int64ToDoubleMBS(value as Int64) as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Math MBS Util Plugin 12.1 Yes Yes Yes Yes No
Function: Converts an Int64 to Double.

Feedback, Comments & Corrections

UInt64ToDoubleMBS(value as UInt64) as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Math MBS Util Plugin 11.1 Yes Yes Yes Yes No
Function: Converts an UInt64 to Double.
Example:
dim d as Double = 18446744073709541376
MsgBox str(d) // fails

dim e as Double = UInt64ToDoubleMBS(18446744073709541376)
MsgBox str(e) // works
Notes: Real Studio likes to use Int64 internally when doing math with UInt64, so we added this method to fix it.

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins