Int64

The Int64 module provides functions for working with explicit 64-bit signed integers. Use Int64 when you need guaranteed 64-bit precision or when interfacing with system APIs and binary protocols that require specific integer sizes.

When to use Int64 vs Int

Kit's default Int type is already 64-bit on most platforms. Use Int64 when you need to be explicit about the size for FFI, binary formats, or cross-platform consistency.

Overview

Int64 represents signed integers in the range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Creation

Int64.from-int
Int -> Int64
Converts a regular Int to Int64.
n = Int64.from-int 42
println n

Arithmetic

Int64 supports the same arithmetic operations as Int: add, sub, mul, div, mod, and neg.

Conversion

Int64.to-int
Int64 -> Int
Converts an Int64 back to a regular Int.
Int64.to-string
Int64 -> String
Converts an Int64 to its string representation.