Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math.round(11.5) 等于多少? Math.round(-11.5)等于多少? #44

Open
strongant opened this issue Apr 1, 2017 · 0 comments
Open

Math.round(11.5) 等于多少? Math.round(-11.5)等于多少? #44

strongant opened this issue Apr 1, 2017 · 0 comments

Comments

@strongant
Copy link
Owner

Math.round(11.5) 等于12
Math.round(-11.5)等于-11
查看源码:
即将原来的数字加上0.5后再向下取整,所以,Math.round(11.5)的结果为12,Math.round(-11.5)的结果为-11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant