Warcraft III resources & community, 2003–2006 · archived

Round

not rated
Submitted by KaTTaNaCalculations0 downloads
Rounds the real r to the nearest integer. Normal R2I always rounds down.
Example:
Round(1.5) == 2
Round(4.25) == 4
Round(6.99) == 7

R2I(1.5) == 1
R2I(4.25) == 4
R2I(6.99) == 6

Source

function Round takes real r returns integer
    return R2I(r+0.5)
endfunction

Comments

0

No comments.