The Number Types

We've seen both f32 for floating point numbers that have a decimal points and i32 for integers that don't. There's a third type of number called u32 which is for "unsigned integer".

A regular i32 integer can be both positive and negative where the negative numbers have a "-" sign in front of them. When we say a u32 is unsigned, it means it can't have a "-" sign. That it turn means it can't be negative.

This brings us to the 32 that follows the f, i, and u in the types. It determines how big a number can be used for the variable.

Here's the values for floating point numbers

typelowest numberhighest number
f8TKTKTKTTKTKTKT
f16TKTKTKTTKTKTKT
f32TKTKTKTTKTKTKT
f64TKTKTKTTKTKTKT
f128TKTKTKTTKTKTKT

Here's the values for integers

typelowest numberhighest number
i8TKTKTKTTKTKTKT
i16TKTKTKTTKTKTKT
i32TKTKTKTTKTKTKT
i64TKTKTKTTKTKTKT
i128TKTKTKTTKTKTKT

And, here's the values for unsigned integers

typelowest numberhighest number
u8TKTKTKTTKTKTKT
u16TKTKTKTTKTKTKT
u32TKTKTKTTKTKTKT
u64TKTKTKTTKTKTKT
u128TKTKTKTTKTKTKT

TODO

  • Fill in the high/low values

  • Add notes about arch