User Tools

Site Tools


4rpl:commands:mod

Index
Arithmetic

mod

<-a <-b mod ->result

Description

Perform integer division and returns the value (modulo) of the difference.

Examples

trace(5 3 mod) #prints '2'
Note:

For floating-point values, in the case of x % y if x and y are positive finite values.

z is the result of x % y and is computed as x – n * y, where n is the largest possible integer that is less than or equal to x / y.

See Also

  • mod2 for a different treatment of negative numbers,

Index

4rpl/commands/mod.txt · Last modified: 2022/05/18 15:30 by Karsten75