# Integer Type
The `Integer` type represents a signed 64-bit integer. It is the primary type for whole numbers in DWScript.
## Literals
Integers can be defined in multiple formats. You can use underscores `_` as digit separators to improve readability of large numbers. DWScript supports both type inference and explicit typing.
| Format | Prefix | Example |
| :--- | :--- | :--- |
| Decimal | (none) | `1_000_000` |
| Hexadecimal | `$` or `0x` | `$FF` or `0xFF` |
| Binary | `%` or `0b` | `%1010` or `0b1010` |
```pascal
// Type inference
var d := 123;
var h := $FF; // 255
var b := %1010; // 10
var big := 1_000_000;
// Explicit typing
var count : Integer := 10;
var status : Integer;
status := 200;
// OUTPUT NONE
```
## Operations
Standard arithmetic operators apply: `+`, `-`, `*`, `div` (integer division), and `mod` (remainder). Bitwise operators like `shl`, `shr`, `and`, `or`, `xor`, and `not` are also supported.
```pascal
var x := 10 div 3; // 3
var y := 10 mod 3; // 1
var z := (1 shl 8); // 256
// OUTPUT NONE
```
## Conversions
You can convert integers to strings or other types using built-in functions or method helpers.
```pascal
var i := 255;
var s := i.ToString; // "255"
var hex := i.ToHexString(2); // "FF"
var val := StrToInt('123');
// OUTPUT NONE
```
## Type Limits
You can retrieve the minimum and maximum possible values for the 64-bit `Integer` type using the `Low` and `High` functions.
```pascal
var min := Low(Integer);
var max := High(Integer);
PrintLn(min.ToString);
PrintLn(max.ToString);
// OUTPUT
// -9223372036854775808
// 9223372036854775807
```
:::info
### Related Reference
* **[Math Reference](/ref/math)** - Absolute value, Min/Max, and more.
* **[Strings Transformation](/ref/strings_transform)** - Detailed conversion options.
:::
Integer Type
The Integer type represents a signed 64-bit integer. It is the primary type for whole numbers in DWScript.
Literals
Integers can be defined in multiple formats. You can use underscores _ as digit separators to improve readability of large numbers. DWScript supports both type inference and explicit typing.
Format
Prefix
Example
Decimal
(none)
1_000_000
Hexadecimal
$ or 0x
$FF or 0xFF
Binary
% or 0b
%1010 or 0b1010
// Type inferencevar d :=123;var h :=$FF;// 255var b :=%1010;// 10var big :=1_000_000;// Explicit typingvar count :Integer:=10;var status :Integer;
status :=200;
Operations
Standard arithmetic operators apply: +, -, *, div (integer division), and mod (remainder). Bitwise operators like shl, shr, and, or, xor, and not are also supported.
var x :=10div3;// 3var y :=10mod3;// 1var z :=(1shl8);// 256
Conversions
You can convert integers to strings or other types using built-in functions or method helpers.
var i :=255;var s := i.ToString;// "255"var hex := i.ToHexString(2);// "FF"var val := StrToInt('123');
Type Limits
You can retrieve the minimum and maximum possible values for the 64-bit Integer type using the Low and High functions.
var min := Low(Integer);var max := High(Integer);
PrintLn(min.ToString);
PrintLn(max.ToString);