iodevs / iodevs/chart

Co pocita fce`linspace`?

Open
#10 12 comments 0 reactions 1 assignee Claimed by @ondrej-tucek View on GitHub
Dominant language
Elixir
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```elixir
def linspace(min, max, step)
when is_number(min) and is_number(max) and is_integer(step) and min < max and 1 < step do
delta = :erlang.abs(max - min) / (step - 1)

Enum.reduce(1..(step - 1), [min], fn x, acc ->
acc ++ [min + x * delta]
end)
end
```

Proc je pouzit `Enum.reduce/3` a pocetne narocne spojovani listu, kdyz lze pouzit `Enum.map/2`.

Co je vystupem teto fce, tedy co reprezentuje vraceny seznam?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.