Skip to content

Commit 17344af

Browse files
committed
Assert on component type
1 parent bbff1eb commit 17344af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/complex.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ defmodule Complex do
8888

8989
defp to_string_component(n) when n == 0, do: "+0.0"
9090

91-
defp to_string_component(n) do
91+
defp to_string_component(n) when is_number(n) do
9292
abs_s = Kernel.to_string(abs(n))
9393

9494
if n >= 0 do

0 commit comments

Comments
 (0)