(%i1) xxx([l]):=length(l)$
(%i2) xxx(3,4,5);
(%o2) 3
On Sun, Jan 15, 2012 at 03:47, Aleksas Domarkas <aleksasd873 at gmail.com>wrote:
> Functions with any number of arguments.
>
> How in Maxima define functions with any number of arguments ?
>
> For example, i need function MIN(arg1,arg2, ...)
> MIN(2) => 2
> MIN(3,4) =>3
> MIN(2/3,1/2,sqrt(2)/2) => 1/2
>
> Other example. How define G with following properties:
> G(n) => gamma(n)
> G(5) => 24
> G(a, x) => gamma_incomplete (a, x)
> G(a, z1, z2) => gamma_incomplete_generalized (a, z1, z2)
>
> (%i1) gamma(5);
> (%o1) 24
>
> Aleksas D.
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>