Skip to content

Commit da8c5ac

Browse files
authored
Merge pull request #282 from pineman/03_numbers_use_threequals
Highlight that Float functions returns float
2 parents a2eaef1 + 22dc340 commit da8c5ac

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

lib/koans/03_numbers.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,26 @@ defmodule Numbers do
8686
end
8787

8888
koan "I don't want this decimal point, let's round up" do
89-
assert Float.ceil(34.25) == ___
89+
assert Float.ceil(34.25) === ___
9090
end
9191

9292
koan "OK, I only want it to 1 decimal place" do
93-
assert Float.ceil(34.25, 1) == ___
93+
assert Float.ceil(34.25, 1) === ___
9494
end
9595

9696
koan "Rounding down is what I need" do
97-
assert Float.floor(99.99) == ___
97+
assert Float.floor(99.99) === ___
9898
end
9999

100100
koan "Rounding down to 2 decimal places" do
101-
assert Float.floor(12.345, 2) == ___
101+
assert Float.floor(12.345, 2) === ___
102102
end
103103

104104
koan "Round the number up or down for me" do
105-
assert Float.round(5.5) == ___
106-
assert Float.round(5.4) == ___
107-
assert Float.round(8.94, 1) == ___
108-
assert Float.round(-5.5674, 3) == ___
105+
assert Float.round(5.5) === ___
106+
assert Float.round(5.4) === ___
107+
assert Float.round(8.94, 1) === ___
108+
assert Float.round(-5.5674, 3) === ___
109109
end
110110

111111
koan "I want the first and last in the range" do

lib/koans/12_pattern_matching.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule PatternMatching do
4545
end
4646
end
4747

48-
koan "So does the keyword lists" do
48+
koan "So must keyword lists" do
4949
kw_list = [type: "car", year: 2016, make: "Honda"]
5050
[_type | [_year | [tuple]]] = kw_list
5151
assert tuple == {___, ___}

lib/koans/13_functions.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ defmodule Functions do
2525
assert first("One") == ___
2626
end
2727

28-
def repeat_again(message, times \\ 5) do
28+
def repeat_again(message, times \\ 3) do
2929
String.duplicate(message, times)
3030
end
3131

test/koans/functions_koans_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule FunctionsTests do
77
"Hello, World!",
88
3,
99
{:multiple, ["One and Two", "Only One"]},
10-
{:multiple, ["Hello Hello Hello Hello Hello ", "Hello Hello "]},
10+
{:multiple, ["Hello Hello Hello ", "Hello Hello "]},
1111
{:multiple, [:entire_list, :single_thing]},
1212
{:multiple, ["10 is bigger than 5", "4 is not bigger than 27"]},
1313
{:multiple, ["The number was zero", "The number was 5"]},

0 commit comments

Comments
 (0)