Specification: BQN primitives

Most primitives are specified by the BQN-based implementation in reference.bqn. This document specifies the basic functionality required by those definitions. Descriptions of other primitives are for informational purposes only.

Arithmetic

Functions here are defined for atoms only; the reference implementations extend them to arrays.

BQN uses five arithmetic functions that are standard in mathematics. The precision of these operations should be specified by the number type.

The three higher functions ร—, รท, and โ‹† apply to numbers and no other atomic types. + and - apply to numbers, and possibly also to characters, according to the rules of the affine character type:

In the first two cases, if the result would not be a valid Unicode code point, then an error results. The remaining cases of + and - (adding two characters; negating a character or subtracting it from a number) are not allowed.