Display a linear combination: Difference between revisions

Content added Content deleted
(Restoring visibility of task description formulae (hidden from most browsers by under-tested cosmetic edits at 21:43, 10 July 2016))
(→‎{{header|Elixir}}: String.lstrip -> trim_leading)
Line 75: Line 75:


=={{header|Elixir}}==
=={{header|Elixir}}==
{{works with|Elixir|1.3}}
<lang elixir>defmodule Linear_combination do
<lang elixir>defmodule Linear_combination do
def display(coeff) do
def display(coeff) do
Line 86: Line 87:
end
end
end)
end)
|> String.lstrip(?+)
|> String.trim_leading("+")
|> case do
|> case do
"" -> IO.puts "0"
"" -> IO.puts "0"