diff options
author | Simon Johansson <simon@findsourcing.com> | 2024-01-29 08:26:04 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-01-30 10:43:42 +0000 |
commit | 8544c4099ca8747486410f33cb1cb0c06ba2f684 (patch) | |
tree | ec734cbd44b38e4f696b4d3c95ba2e51f35db5e6 /src/content/chapter0_basics/lesson05_floats/code.gleam | |
parent | c2145387b54904694cadbc3140bd89ce1dc6a185 (diff) | |
download | tour-8544c4099ca8747486410f33cb1cb0c06ba2f684.tar.gz tour-8544c4099ca8747486410f33cb1cb0c06ba2f684.zip |
Explain runtime differences for floats
Diffstat (limited to 'src/content/chapter0_basics/lesson05_floats/code.gleam')
-rw-r--r-- | src/content/chapter0_basics/lesson05_floats/code.gleam | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/content/chapter0_basics/lesson05_floats/code.gleam b/src/content/chapter0_basics/lesson05_floats/code.gleam index 8c4e89a..4241ab4 100644 --- a/src/content/chapter0_basics/lesson05_floats/code.gleam +++ b/src/content/chapter0_basics/lesson05_floats/code.gleam @@ -18,6 +18,9 @@ pub fn main() { io.debug(1.1 == 1.1) io.debug(2.1 == 1.2) + // Division by zero is not an error + io.debug(3.14 /. 0.0) + // Standard library float functions io.debug(float.max(2.0, 9.5)) io.debug(float.ceiling(5.4)) |