字符串加倍,精度丢失
当我执行 [string_variable doubleValue]
时,字符串中有 53.025709438664,我得到 53.025709。
我使用 NSLog(@"%f") 来打印它。
如何获得完整的精度值?
I have 53.025709438664 in string when I do [string_variable doubleValue]
, I get 53.025709.
I use NSLog(@"%f")
to print it.
How I can get full precision value ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请查看 中提供的格式说明符苹果文档。
您无法获取小数点后的所有数字。
编辑:
如果您知道小数点后的确切位数,那么我们可以使用如下内容
Please have a look at the format specifiers provided in Apple doc.
You cannot get all the digits after decimal point.
Edit:
If you know exact number of digits after decimal, then we could use something as follows