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
| type | lowest number | highest number |
|---|---|---|
| f8 | TKTKTKT | TKTKTKT |
| f16 | TKTKTKT | TKTKTKT |
| f32 | TKTKTKT | TKTKTKT |
| f64 | TKTKTKT | TKTKTKT |
| f128 | TKTKTKT | TKTKTKT |
Here's the values for integers
| type | lowest number | highest number |
|---|---|---|
| i8 | TKTKTKT | TKTKTKT |
| i16 | TKTKTKT | TKTKTKT |
| i32 | TKTKTKT | TKTKTKT |
| i64 | TKTKTKT | TKTKTKT |
| i128 | TKTKTKT | TKTKTKT |
And, here's the values for unsigned integers
| type | lowest number | highest number |
|---|---|---|
| u8 | TKTKTKT | TKTKTKT |
| u16 | TKTKTKT | TKTKTKT |
| u32 | TKTKTKT | TKTKTKT |
| u64 | TKTKTKT | TKTKTKT |
| u128 | TKTKTKT | TKTKTKT |
TODO
-
Fill in the high/low values
-
Add notes about
arch