User Tools

Site Tools


4rpl:commands:mod

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
4rpl:commands:mod [2021/01/20 15:40] – crosslinked mod and mod2 Karsten754rpl:commands:mod [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-<=[[4rpl:start| Index]]+<=[[4rpl:start| Index]] \\ 
 +<=[[4rpl:start#arithmetic| Arithmetic]]
  
 ====== mod ====== ====== mod ======
Line 7: Line 8:
 ===== Description ===== ===== Description =====
 Perform integer division and returns the value (modulo) of the difference. Perform integer division and returns the value (modulo) of the difference.
- 
-See [[mod2]] for a different treatment of negative numbers, 
  
 ===== Examples ===== ===== Examples =====
Line 14: Line 13:
 trace(5 3 mod) #prints '2' trace(5 3 mod) #prints '2'
 </code> </code>
 +
 +<WRAP indent>
 +  ? **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.
 +</WRAP>
 +
 +=== See Also ===
 +  * [[4rpl:commands:mod2]] for a different treatment of negative numbers,
 +
 <=[[4rpl:start| Index]] <=[[4rpl:start| Index]]
  
4rpl/commands/mod.1611157222.txt.gz · Last modified: 2025/02/14 14:56 (external edit)