Maximum difference between adjacent elements of list: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|Raku}}: Real number? I bite my thumb at your real numbers...) |
m (→{{header|Julia}}: expand types) |
||
Line 232: | Line 232: | ||
<lang julia> |
<lang julia> |
||
function maxadjacentdiffs(list) |
function maxadjacentdiffs(list) |
||
pairs, maxδ = Pair{eltype(list)}[], zero(eltype(list)) |
pairs, maxδ = Pair{eltype(list)}[], abs(zero(eltype(list))) |
||
for i in eachindex(list[begin:end-1]) |
for i in eachindex(list[begin:end-1]) |
||
x, y = list[i], list[i + 1] |
x, y = list[i], list[i + 1] |