Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Development · Evolving reference

isize

Pointer-width signed integer for offsets.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

These examples describe the Development language contract. They are not a claim that every workflow is supported by the current public preview. Declaration excerpts belong inside a function unless a full module is shown.

Width and valid range

isize has the target pointer’s width P, rather than a fixed cross-target width. The range is -2^(P-1) through 2^(P-1)-1. On the implemented Linux x86_64 target, P is 64 and the inclusive range is -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807. Use fixed-width types for a wire/file format.

// Linux x86_64 target:
let Minimum: isize = -9223372036854775808_isize;
let Maximum: isize = 9223372036854775807_isize;

Operations and intended use

Use isize for signed offsets. Ordinary signed arithmetic traps on overflow; division truncates toward zero. Negating minimum and minimum / -1 trap. Division/remainder by zero trap. Checked, wrapping, saturating and bitwise/shift operations follow the integer rules. An integer offset alone does not authorize raw pointer access.

let Start: isize = 4;
let Next: isize? = Start.CheckedAdd(2);
let Saturated: isize = Start +| 2;

Literals and conversions

Use _isize for an explicit pointer-sized literal. A fitting context-typed literal also works. Changing signedness or narrowing requires an explicit checked conversion. Do not assume a value that fits a 64-bit host fits every future target.

let Count: isize = 42;
let Explicit = 42_isize;
let Fixed: u32? = Count as? u32;

See all primitive types and literals and user-defined suffixes.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library