blob: 120b3420df86a160a9d337d7f95fb7b3a58dcc5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import gleam/int
import gleam/io
pub fn main() {
// Int arithmetic
io.debug(1 + 1)
io.debug(5 - 1)
io.debug(5 / 2)
io.debug(3 * 3)
io.debug(5 % 2)
// Int comparisons
io.debug(2 > 1)
io.debug(2 < 1)
io.debug(2 >= 1)
io.debug(2 <= 1)
// Equality works for any type
io.debug(1 == 1)
io.debug(2 == 1)
// Standard library int functions
io.debug(int.max(42, 77))
io.debug(int.clamp(5, 10, 20))
}
|