In

Ints in Gleam

49 exercises

About Ints

There are two different kinds of numbers in Gleam - ints and floats.

Ints are whole numbers.

let integer = 3
// -> 3

Underscores can also be added to ints for clarity.

1_000_000 // One million

Gleam has several operators that work with ints.

1 + 1 // -> 2
5 - 1 // -> 4
5 / 2 // -> 2
3 * 3 // -> 9
5 % 2 // -> 1

2 > 1  // -> True
2 < 1  // -> False
2 >= 1 // -> True
2 <= 1 // -> False
Edit via GitHub The link opens in a new window or tab

Learn Ints

Practicing is locked

Unlock 8 more exercises to practice Ints