RosettaCodeData/Task/Call-a-function/PARI-GP/call-a-function.pari

8 lines
305 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
f(); \\ zero arguments
sin(Pi/2); \\ fixed number of arguments
2015-11-18 06:14:39 +00:00
vecsort([5,6]) != vecsort([5,6],,4) \\ optional arguments
Str("gg", 1, "hh") \\ variable number of arguments
call(Str, ["gg", 1, "hh"]) \\ variable number of arguments in a vector
2013-04-10 22:43:41 -07:00
(x->x^2)(3); \\ first-class
x = sin(0); \\ get function value