ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


rounding

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
rounding [2019/08/26 21:01]
korshun [Rounding]
rounding [2019/08/26 21:02] (current)
korshun
Line 1: Line 1:
-===== Rounding =====+====== Rounding====== 
 + 
 +===== Introduction ​=====
  
 ACSUtils provides a full set of functions to round fixed-point numbers to integers. ACSUtils provides a full set of functions to round fixed-point numbers to integers.
Line 8: Line 10:
 </​note>​ </​note>​
  
-==== Rounding modes ====+===== Rounding modes =====
  
 There are four rounding modes: There are four rounding modes:
Line 27: Line 29:
 ^  -1.8|        -2|        -2|       ​-1| ​       -1| ^  -1.8|        -2|        -2|       ​-1| ​       -1|
  
-==== Rounding functions in ACSUtils ​====+===== Functions =====
  
 Every rounding mode is available as two functions: Every rounding mode is available as two functions:
Line 38: Line 40:
 ^ round | ''​fixed round(fixed x)''​ | ''​int iround(fixed x)''​ | ^ round | ''​fixed round(fixed x)''​ | ''​int iround(fixed x)''​ |
 ^ trunc | ''​fixed trunc(fixed x)''​ | ''​int itrunc(fixed x)''​ | ^ trunc | ''​fixed trunc(fixed x)''​ | ''​int itrunc(fixed x)''​ |
 +
  
  
rounding.txt · Last modified: 2019/08/26 21:02 by korshun