请考虑以下代码:
0.1 + 0.2 == 0.3 -> false
0.1 + 0.2 -> 0.30000000000000004
为什么会出现这些不准确之处?
language-agnostic math floating-point floating-accuracy
我有一个数字可以说0.00.
0.00
0.01
0.12
1.23
12.34
我怎么能用Swift做到这一点?
uitextfield nsnumberformatter ios swift swift3
floating-accuracy ×1
floating-point ×1
ios ×1
language-agnostic ×1
math ×1
nsnumberformatter ×1
swift ×1
swift3 ×1
uitextfield ×1