User Tools

Site Tools


4rpl:commands:div

Index
Arithmetic

div

<-a <-b div ->result

Description

Divides the two arguments together and pushes the result on the stack. the output type (integer or float) depends on the input, except is the result is explicitly cast. See examples.

Examples

trace(5 4 div) #prints '1'. Both arguments are integers so division is integer division
trace(5 4.0 div) #prints '1.2'. Handled as floating point division
trace(5 asfloat(4) div) #prints '1.2'. Handled as floating point division

Index

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