Many
Many[value, count]
Constructs a list consisting of value repeated count times.
- Returns a
Listcontainingcountcopies ofvalue.
Many["a", 3]; (* => {"a", "a", "a"} *)
Many[0, 5]; (* => {0, 0, 0, 0, 0} *)
Map
Map[list, fun]
Applies the function fun to each element of list and returns a new list containing the results.
- Returns a
Listwith the same length as the input.
Map[{ 1, 2, 3 }, Fun[{ x }, Add[x, 3]]]; (* => {4, 5, 6} *)
Map[{ "a", "b" }, Fun[{ s }, Concat[s, "!"] ]]; (* => {"a!", "b!"} *)
Max
Max[a, b]
Returns the larger of two numbers a and b.
- Returns a
Number.
Max[10, 20]; (* => 20 *)
Max[-5, -10]; (* => -5 *)
Max[Exp[ArcTan2[-1, 0]], Power[ArcTan2[-1, 0], Exp[1]]]; (* => 23.1406926327793 *)
Min
Min[a, b]
Returns the smaller of two numbers a and b.
- Returns a
Number.
Min[10, 20]; (* => 10 *)
Min[-5, -10]; (* => -10 *)
Min[Exp[ArcTan2[-1, 0]], Power[ArcTan2[-1, 0], Exp[1]]]; (* => 22.459157718361 *)
Mkdir
Mkdir[path]
Mkdir[path, is_rec]
Creates a new directory at the specified path.
- If
is_recis#t, creates parent directories as needed (equivalent tomkdir -p). - Returns
Unit[].
Mkdir["new_dir"]; (* Creates a single directory *)
Mkdir["path/to/nested/dir", #t]; (* Creates all missing parent directories *)
Mod
Mod[n, p]
Computes the mathematical modulo of n with respect to p.
Unlike remainder (Rem), the result always has the same sign as the divisor p.
- Returns a
Number.
Mod[10, 3]; (* => 1 *)
Mod[10, -3]; (* => -2 *)
Mod[-10, 3]; (* => 2 *)
Module
Module[name]
Declares the current file as a module with the given name.
May appear at most once per file, at any position.
nameis aStringidentifying the module.- Returns
Unit[].
Module["main"];
Mul
Mul[n1, n2, ...]
Computes the product of one or more numbers. If only one argument is provided, that argument is returned unchanged.
- Returns a
Number.
Mul[10, 20, 3]; (* => 600 *)
Mul[2.5, 4]; (* => 10 *)
Mul[42]; (* => 42 *)
Mul[2, 3, Mul[4, 5]]; (* => 120 *)