Math¶
Arithmetic on numbers, amounts of money, percents, times, dates and pairs, and the operators written between
values: 2 + 3 is add 2 3. Integers are 64-bit; an operation that does not fit is an error, never a wrong
number. money! is exact, every digit kept, while decimal! is a floating-point number shown to 15 digits. See values.
add¶
The sum of two values.
add a b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
subtract¶
The difference of two values.
subtract a b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
multiply¶
The product of two values.
multiply a b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
divide¶
The first value divided by the second.
divide a b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
remainder¶
What is left after dividing the first value by the second.
remainder a b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
mod¶
The remainder of a divided by b, with the sign of b.
mod a b
a(number!money!time!)b(number!money!time!): Must not be zero
modulo¶
Like mod, but a remainder too small to tell from b or zero is zero.
modulo a b
a(number!money!time!)b(number!money!time!): Must not be zero
negate¶
The value with its sign changed.
negate value
value(number!money!time!pair!date!)
abs¶
The value without its sign.
abs value
value(number!money!time!pair!date!)
round¶
The value rounded to the nearest whole number, or to a multiple of a scale.
round value
value(number!money!time!)/to scale(number!money!time!)/even/down/half-down/floor/ceiling/half-ceiling
power¶
The number raised to the exponent.
power number exponent
number(number!)exponent(number!)
square-root¶
The square root of the number.
square-root value
value(number!)
exp¶
e raised to the power of the number.
exp power
power(number!)
log-e¶
The natural logarithm of the number.
log-e value
value(number!)
log-10¶
The base-10 logarithm of the number.
log-10 value
value(number!)
log-2¶
The base-2 logarithm of the number.
log-2 value
value(number!)
sine¶
The sine of an angle, in degrees.
sine angle
angle(number!)/radians: The angle is in radians
cosine¶
The cosine of an angle, in degrees.
cosine angle
angle(number!)/radians: The angle is in radians
tangent¶
The tangent of an angle, in degrees.
tangent angle
angle(number!)/radians: The angle is in radians
arcsine¶
The angle whose sine is the value, in degrees.
arcsine value
value(number!)/radians: Give the angle in radians
arccosine¶
The angle whose cosine is the value, in degrees.
arccosine value
value(number!)/radians: Give the angle in radians
arctangent¶
The angle whose tangent is the value, in degrees.
arctangent value
value(number!)/radians: Give the angle in radians
arctangent2¶
The angle of the point x, y, in degrees.
arctangent2 y x
y(number!)x(number!)/radians: Give the angle in radians
random¶
A random value: an integer from 1 to it, a decimal up to it, a shuffled series.
random value
value(any-value!)/seed: Start the sequence from this value; gives nothing/only: Pick one element of a series
zero?¶
True if the value is zero.
zero? value
value(number!money!time!pair!date!)
even?¶
True if the integer is even.
even? value
value(integer!)
odd?¶
True if the integer is odd.
odd? value
value(integer!)
sign?¶
Gives -1, 0 or 1 by the sign of the value.
sign? value
value(number!money!time!)
negative?¶
True if the value is less than zero.
negative? value
value(number!money!time!)
positive?¶
True if the value is more than zero.
positive? value
value(number!money!time!)
max¶
The greater of two values.
max a b
a(any-value!)b(any-value!)
min¶
The lesser of two values.
min a b
a(any-value!)b(any-value!)
and~¶
Both values: bitwise for integers and binaries, logical for anything else.
and~ a b
a(any-value!)b(any-value!)
or~¶
Either value: bitwise for integers and binaries, logical for anything else.
or~ a b
a(any-value!)b(any-value!)
xor~¶
One value or the other but not both: bitwise for integers and binaries, logical for anything else.
xor~ a b
a(any-value!)b(any-value!)
and¶
Both values: bitwise for integers and binaries, logical for anything else.
An operator, written between its values: a and b is and~ a b (see and~).
a and b
a(any-value!)b(any-value!)
or¶
Either value: bitwise for integers and binaries, logical for anything else.
An operator, written between its values: a or b is or~ a b (see or~).
a or b
a(any-value!)b(any-value!)
xor¶
One value or the other but not both: bitwise for integers and binaries, logical for anything else.
An operator, written between its values: a xor b is xor~ a b (see xor~).
a xor b
a(any-value!)b(any-value!)
shift¶
Shifts the bits of an integer right, or left with /left.
shift data bits
data(integer!)bits(integer!): How many bits/left: Shift to the left/logical: Shift zeros in, not the sign
shift-left¶
Shifts the bits of an integer left.
shift-left data bits
data(integer!)bits(integer!): How many bits
shift-right¶
Shifts the bits of an integer right, keeping its sign.
shift-right data bits
data(integer!)bits(integer!): How many bits
shift-logical¶
Shifts the bits of an integer right, shifting zeros in.
shift-logical data bits
data(integer!)bits(integer!): How many bits
+¶
The sum of two values.
An operator, written between its values: a + b is add a b (see add).
a + b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
-¶
The difference of two values.
An operator, written between its values: a - b is subtract a b (see subtract).
a - b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
*¶
The product of two values.
An operator, written between its values: a * b is multiply a b (see multiply).
a * b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
/¶
The first value divided by the second.
An operator, written between its values: a / b is divide a b (see divide).
a / b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
//¶
What is left after dividing the first value by the second.
An operator, written between its values: a // b is remainder a b (see remainder).
a // b
a(number!money!time!pair!date!)b(number!money!time!pair!date!)
**¶
The number raised to the exponent.
An operator, written between its values: number ** exponent is power number exponent (see power).
number ** exponent
number(number!)exponent(number!)
<<¶
Shifts the bits of an integer left.
An operator, written between its values: data << bits is shift-left data bits (see shift-left).
data << bits
data(integer!)bits(integer!): How many bits
>>¶
Shifts the bits of an integer right, keeping its sign.
An operator, written between its values: data >> bits is shift-right data bits (see shift-right).
data >> bits
data(integer!)bits(integer!): How many bits
>>>¶
Shifts the bits of an integer right, shifting zeros in.
An operator, written between its values: data >>> bits is shift-logical data bits (see shift-logical).
data >>> bits
data(integer!)bits(integer!): How many bits