整数的角形式输入的max max和min min是多少? [英] What is the max max and min min for angular form input for integers?
问题描述
使用角度输入数字时,我注意到如果输入较大的数字,它们可能会四舍五入为不同的值.
With angular input numbers, I notice that if I enter large numbers they can get rounded to something different.
例如,在此plunkr中 http://plnkr.co/edit/k5G7eL8gIzWbSPGocdlQ?p=预览我设置了一个较大的最大数字,如下所示:
For example, in this plunkr http://plnkr.co/edit/k5G7eL8gIzWbSPGocdlQ?p=preview I set a large max number like this:
<input type="number" name="input" ng-model="value" min="0" max="9223372036854769" required>
然后,如果我在输入字段中输入9223372036854769,则将其四舍五入.如果我输入9223372036854767,它会四舍五入.
Then, if I enter 9223372036854769 in the input field it gets rounded down one. If I enter 9223372036854767 it gets rounded up one.
仅考虑整数(无小数),不取整就可以输入的最大整数值是多少?最低要求是什么?
Considering only integer numbers (no decimals), what is the maximum integer value inputs can receive without rounding? And what is the minimum?
推荐答案
与角度无关,但与JavaScript无关,在JavaScript中,数字的正负精度最高为2 ^ 53.
It is not related to angular but more so to JavaScript in which numbers have precision up to 2^53 both positive and negative.
这篇关于整数的角形式输入的max max和min min是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!