Hello,

how can I pass one or more additional (constant) argument(s) to a
function applied via the map() function to an array?

I tried to search for a solution and also stumbled upon a posting [1]
which touches a similar topic but unfortunately does not answer my
question.


Minimal (rather artificial :) example:

function myround(x::Float64, digits::Integer)
    round(x, digits)
end

a = log(2:5)
map(myround, a)

Question: How can I pass the digits argument to the calls of round
within map? 'map(myround, a, 2)' only processes the first element.

Thanks in advance!

Best,
Michael

[1] https://groups.google.com/forum/#!topic/julia-users/eD52IwO-qFw

Reply via email to