原语float和double支持多少个小数位? [英] How many decimal places does the primitive float and double support?

查看:149
本文介绍了原语float和double支持多少个小数位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已读过双重商店15位数字和浮动广告商店7位数字。

I have read that double stores 15 digits and float stores 7 digits.

我的问题是,这些数字是支持的小数位数或总位数在数字?

My question is, are these numbers the number of decimal places supported or total number of digits in a number?

推荐答案

这些是有效数字的总数,如果你愿意,从左到右,小数点的位置。

Those are the total number of "significant figures" if you will, counting from left to right, regardless of where the decimal point is. Beyond those numbers of digits, accuracy is not preserved.

您列出的计数是基于10的数字。

The counts you listed are for the base 10 representation.

这篇关于原语float和double支持多少个小数位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆