aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinoas <mail@inoas.com>2022-10-10 11:58:17 +0200
committerLouis Pilfold <louis@lpil.uk>2022-10-10 19:42:33 +0100
commit3e8a8f8ae758eb33026d1633ee9c95d10131c03b (patch)
tree304287896aa870f3482c376122ce0e829221afd4
parent8e8d5ac2a44b33ba3497a4f4b3e2719376ae01dc (diff)
downloadgleam_stdlib-3e8a8f8ae758eb33026d1633ee9c95d10131c03b.tar.gz
gleam_stdlib-3e8a8f8ae758eb33026d1633ee9c95d10131c03b.zip
docblock, changelog
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/gleam/int.gleam3
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84529b8..079ad6c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
- `string.slice` is now tail recursive and will no longer blog the stack on
large inputs when running on JavaScript.
+- Added `int.floor_divide` to complement the truncated `int.divide`.
## v0.23.0 - 2022-09-15
diff --git a/src/gleam/int.gleam b/src/gleam/int.gleam
index 6a30e60..295381c 100644
--- a/src/gleam/int.gleam
+++ b/src/gleam/int.gleam
@@ -527,7 +527,8 @@ pub fn divide(a: Int, by b: Int) -> Result(Int, Nil) {
/// If you want to perform truncated integer division (rounding towards zero),
/// use `int.divide()` or the `/` operator instead.
///
-/// Returns division of the inputs as a `Result`.
+/// Returns division of the inputs as a `Result`: If the given divisor equals
+/// `0`, this function returns an `Error`.
///
/// ## Examples
///