?? [ra?nd]
adj. ?? ??, ??? ??,
adv. ?? ??; ??)
n.?, ??; (??)
vt.& vi.
3?? ??: rounds ??: rounds ?? ??: rounding ?? ??: rounded ?? ??: rounded ???: rounder ???: roundest
?????? round() ??? ???
??: ??? ?? ??? ??? ??????.
??: ??Math.round(x)
????: x ?????. ???? ???.?
??: x? ?? ??? ??.
??: 0.5? ?? ? ??? ??????. ?? ??, 3.5? 4? ?????, -3.5? -3?? ??????.
?????? round() ??? ?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <script type="text/javascript"> //不同的數(shù)舍入為最接近的整數(shù) document.write(Math.round(0.60) + "<br />") document.write(Math.round(0.50) + "<br />") document.write(Math.round(0.49) + "<br />") document.write(Math.round(-4.40) + "<br />") document.write(Math.round(-4.60)) </script> </body> </html>
???? ?? ?
??? ????? ??? "???? ??" ??? ?????