aboutsummaryrefslogtreecommitdiff
path: root/lessons/src/lesson004_ints
diff options
context:
space:
mode:
Diffstat (limited to 'lessons/src/lesson004_ints')
-rw-r--r--lessons/src/lesson004_ints/code.gleam4
-rw-r--r--lessons/src/lesson004_ints/text.html12
2 files changed, 11 insertions, 5 deletions
diff --git a/lessons/src/lesson004_ints/code.gleam b/lessons/src/lesson004_ints/code.gleam
index 5076902..cb7991b 100644
--- a/lessons/src/lesson004_ints/code.gleam
+++ b/lessons/src/lesson004_ints/code.gleam
@@ -15,6 +15,10 @@ pub fn main() {
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))
diff --git a/lessons/src/lesson004_ints/text.html b/lessons/src/lesson004_ints/text.html
index 32a7aa8..252496a 100644
--- a/lessons/src/lesson004_ints/text.html
+++ b/lessons/src/lesson004_ints/text.html
@@ -1,8 +1,7 @@
+<p>Gleam's <code>Int</code> type represents whole numbers.</p>
<p>
- Gleam's <code>Int</code> type represents whole numbers.
-</p>
-<p>
- There are arithmetic and comparison operators for ints.
+ There are arithmetic and comparison operators for ints, as well as the
+ equality operator which works on all types.
</p>
<p>
When running on the Erlang virtual machine ints have no maximum and minimum
@@ -10,6 +9,9 @@
JavaScript's 64 bit floating point numbers,
</p>
<p>
- The <a href="https://hexdocs.pm/gleam_stdlib/gleam/int.html"><code>gleam/int</code></a>
+ The
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/int.html"
+ ><code>gleam/int</code></a
+ >
standard library module contains functions for working with ints.
</p>