Skip to content

Commit 17344af

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/complex.ex

+1-1
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)