Xojo Conferences
 XDC May 2019 Miami USA MBS Oct 2019 Cologne DE

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.

#### Blog Entries

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 valuedim 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 rightdim 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.

#### Blog Entries

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.

#### Blog Entries

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 = 18446744073709541376MsgBox str(d) // failsdim 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.