Skip to content

Commit c220c15

Browse files
dimimari-flutterintulysses4ever
authored andcommitted
fix: Add sign to doubleSmallNumber example
The `doubleSmallNumber` description says a number is multiplied by 2 only if that number is smaller than or equal to 100, however the example does not work when the number is equal to 100.
1 parent 262dd20 commit c220c15

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

source_md/starting-out.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Functions in Haskell don't have to be in any particular order, so it doesn't mat
240240
Now we're going to make a function that multiplies a number by 2 but only if that number is smaller than or equal to 100 because numbers bigger than 100 are big enough as it is!
241241

242242
```{.haskell:hs}
243-
doubleSmallNumber x = if x > 100
243+
doubleSmallNumber x = if x >= 100
244244
then x
245245
else x*2
246246
```
@@ -902,4 +902,3 @@ ghci> rightTriangles'
902902
And there's our answer!
903903
This is a common pattern in functional programming.
904904
You take a starting set of solutions and then you apply transformations to those solutions and filter them until you get the right ones.
905-

0 commit comments

Comments
 (0)