Problem: How to map a function onto a list. My (example input:
mylist = {{1, 2}, {3, 4}}
gg[x_, y_] := {N[x + y], N[x y]}
Map[gg, mylist]
Expected output:
{{3., 2.}, {7., 12.}}
Actual output:
{gg[{1, 2}], gg[{3, 4}]}
How do I get gg[.] to give a numerical (function evaluated) output of mylist?
gg[{x_, y_}] := {N[x + y], N[x y]}– user42582 May 09 '18 at 20:48gg @@@ mylist. But if you need to useMapthenApply[gg] /@ mylist. – Kuba May 09 '18 at 20:50