DataType

# UInt64

<div class="rst-class">

forsearch

</div>

DataType

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to store unsigned 64-bit integer values. The default value is 0. Generally you will use the Integer data type (equivalent to `Int32</api/data_types/additional_types/int32>` on 32-bit apps or `Int64</api/data_types/additional_types/int64>` on 64-bit apps) or `UInteger</api/data_types/additional_types/uinteger>` (equivalent to `UInt32</api/data_types/additional_types/uint32>` on 32-bit apps or <span class="title-ref">UInt64</span> on 64-bit apps). This size-specific integer data type is available for use with external OS APIs.

## Notes

<span class="title-ref">UInt64</span> values can range from 0 to 2^64-1 (18,446,744,073,709,551,615) and use 8 bytes.

All integers on Android are 64-bit integers.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Comparing a <span class="title-ref">UInt64</span> to a literal or constant

The type of a numeric literal or constant that is a whole number is the same `integer</api/data_types/integer>` type as the architecture of the platform for which you are building. That means that if you are building for 64 bit, literals and constants will be 64 bit (signed) `integers</api/data_types/integer>`.

Therefore to correctly compare them, use `CType</api/language/ctype>` to cast the literal to a <span class="title-ref">UInt64</span>.

In this example the variable Distance is a \`UInt64\`:

``` xojo
If Distance = CType(0, UInt64) Then
  MessageBox("You have arrived.")
End If
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`UInteger</api/data_types/additional_types/uinteger>`, `UInt8</api/data_types/additional_types/uint8>`, `UInt16</api/data_types/additional_types/uint16>`, and `UInt32</api/data_types/additional_types/uint32>` data types.

</div>
