Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Primitives

Whamm offers a small set of primitive types that are useful for performing arithmetic and representing data.

Booleans

With only two values, true, and false, booleans are represented in Whamm with the type bool.

var x: bool; // default == false
x = true;
x = false;

Integers

Right now, Whamm supports the following types:

typebitsdescriptionminmax
u88unsigned values0255 (equal to 2^8 - 1)
i88signed values-128 (equal to -2^7)127 (equal to 2^7 - 1)
u1616unsigned values065_535 (equal to 2^16 - 1)
i1616signed values-32_768 (equal to -2^15)32_767 (equal to 2^15 - 1)
u3232unsigned values04_294_967_295 (equal to 2^32 - 1)
i3232signed values-2_147_483_648 (equal to -2^31)2_147_483_647 (equal to 2^31 - 1)
f3232floating point values-3.40282347E+383.40282347E+38
u6464unsigned values04_294_967_295 (equal to 2^32 - 1)
i6464signed values-2_147_483_648 (equal to -2^31)18_446_744_073_709_551_615 (equal to 2^63 - 1)
f6464floating point values-1.7976931348623157E+3081.7976931348623157E+308
// with declared types
var d: i32; // default == 0
d = 0;
d = 9993;
d = -42;