Open lue-bird opened 12 months ago
when expectNaN is enabled
expectNaN
-- also works when NaN is on the other side (0 / 0) + n --> 0 / 0 (0 / 0) - n --> 0 / 0 (0 / 0) * n --> 0 / 0 (0 / 0) / n --> 0 / 0
List.product and List.sum were implemented in #257
List.product
List.sum
If you think there are more, comment or edit this issue.
Edit: thanks to Simon Lydell on slack for finding out that these ↓ only sometimes return NaN: Basics.max (0 / 0) n --> ❌ 0 / 0 Basics.min (0 / 0) n --> ❌ 0 / 0 List.maximum [ a, 0 / 0, b ] --> ❌ Just (0 / 0) List.minimum [ a, 0 / 0, b ] --> ❌ Just (0 / 0) The edge cases: Basics.min (0 / 0) 5 --> 5 Basics.min 5 (0 / 0) --> 0 / 0
Edit: thanks to Simon Lydell on slack for finding out that these ↓ only sometimes return NaN:
Basics.max (0 / 0) n --> ❌ 0 / 0 Basics.min (0 / 0) n --> ❌ 0 / 0 List.maximum [ a, 0 / 0, b ] --> ❌ Just (0 / 0) List.minimum [ a, 0 / 0, b ] --> ❌ Just (0 / 0)
The edge cases:
Basics.min (0 / 0) 5 --> 5 Basics.min 5 (0 / 0) --> 0 / 0
Basics.max (0 / 0) 5 --> 0 / 0 Basics.max 5 (0 / 0) --> 5
List.minimum [ 0 / 0, 5 ] --> Just ( 0 / 0) List.minimum [ 5, 0 / 0 ] --> Just 5
List.maximum [ 0 / 0, 5 ] --> Just 5 List.maximum [ 5, 0 / 0 ] --> Just (0 / 0)
when
expectNaN
is enabledList.product
andList.sum
were implemented in #257If you think there are more, comment or edit this issue.
Basics.max (0 / 0) 5 --> 0 / 0 Basics.max 5 (0 / 0) --> 5
List.minimum [ 0 / 0, 5 ] --> Just ( 0 / 0) List.minimum [ 5, 0 / 0 ] --> Just 5
List.maximum [ 0 / 0, 5 ] --> Just 5 List.maximum [ 5, 0 / 0 ] --> Just (0 / 0)