Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
| Math.round( ) | Rundet auf die nächste ganze Zahl |
Math.round(x)
x
Eine beliebige Zahl.
Der Integer, der x am nächsten kommt.
Die Methode Math.round( ) rundet ihr Argument auf die nächstgelegene ganze Zahl auf oder ab. Der Wert .5 wird aufgerundet. So wird z.B. 2.5 auf 3 und −2.5 auf −2 gerundet.