diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/gleam/int.gleam | 3 |
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 /// |