Skip to content

Plus

Add numbers.

$ wo 'Plus[1, 2]'
3
$ wo 'Plus[1, 2, 3]'
6
$ wo 'Plus[-1, -2]'
-3

+

$ wo '1+2'
3
$ wo '8 + (-5)'
3

List arithmetic (threading)

Arithmetic operations are automatically threaded over lists:

$ wo '{1, 2, 3} + 2'
{3, 4, 5}
$ wo '2 + {1, 2, 3}'
{3, 4, 5}
$ wo '{1, 2, 3} + {4, 5, 6}'
{5, 7, 9}
$ wo '{1, 2, 3} - 1'
{0, 1, 2}
$ wo '{1, 2, 3} * 2'
{2, 4, 6}
$ wo '{2, 4, 6} / 2'
{1, 2, 3}
$ wo '{1, 2, 3} ^ 2'
{1, 4, 9}