aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gleam/float.gleam2
-rw-r--r--src/gleam/int.gleam2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gleam/float.gleam b/src/gleam/float.gleam
index 5893b44..1ee175c 100644
--- a/src/gleam/float.gleam
+++ b/src/gleam/float.gleam
@@ -427,7 +427,7 @@ fn do_sum(numbers: List(Float), initial: Float) -> Float {
///
pub fn product(numbers: List(Float)) -> Float {
case numbers {
- [] -> 0.0
+ [] -> 1.0
_ -> do_product(numbers, 1.0)
}
}
diff --git a/src/gleam/int.gleam b/src/gleam/int.gleam
index eafbade..7623331 100644
--- a/src/gleam/int.gleam
+++ b/src/gleam/int.gleam
@@ -465,7 +465,7 @@ fn do_sum(numbers: List(Int), initial: Int) -> Int {
///
pub fn product(numbers: List(Int)) -> Int {
case numbers {
- [] -> 0
+ [] -> 1
_ -> do_product(numbers, 1)
}
}