Scalar Operators
Numerical operators
Learn how to use and combine numerical operators in APL.
Numerical operators
The types int
, long
, and real
represent numerical types. The following operators can be used between pairs of these types:
Operator | Description | Example | |
---|---|---|---|
+ | Add | 3.19 + 3.19 , ago(10m) + 10m | |
- | Subtract | 0.26 - 0.23 | |
* | Multiply | 1s * 5 , 5 * 5 | |
/ | Divide | 10m / 1s , 4 / 2 | |
% | Modulo | 10 % 3 , 5 % 2 | |
< | Less | 1 < 2 , 1 <= 1 | |
> | Greater | 0.23 > 0.22 , 10min > 1sec , now() > ago(1d) | |
== | Equals | 3 == 3 | |
!= | Not equals | 2 != 1 | |
<= | Less or Equal | 5 <= 6 | |
>= | Greater or Equal | 7 >= 6 | |
in | Equals to one of the elements | "abc" in ("123", "345", "abc") | |
!in | Not equals to any of the elements | "bca" !in ("123", "345", "abc") |