You can either have a big number and a small decimal point or small number and a big decimal point.
可以小数点前面长,后面短,或者,前面短,后面长。
It just throws the decimal point away and that's because, again, these are ints and the answer intuitively should be a floating point value, but I need to be more specific.
它直接把小数点后面的数值丢弃掉了,因为,凭直觉,那些整型数和结果应该是一个浮点数据,但是我需要一个更精确的数值。
And there's probably more digits after the decimal place, but because of my formatting string, I only see a couple of them.
这里可能有更多的小数位,但因为我对结果设定了格式,我们只看到两位。
You don't need this hack of just, like, manually adding a decimal point just to fix that problem.
你不需要这样来操作,比如,手动地加入小数点来修正这个错误。
So a floating point value again is a number with a decimal point, so it depends.
一个浮点型数据就是一个,带小数点的数。
But at the end of the day, and here's why we just went with binary and not decimal years ago, when you have one implement a computer with a physical device, it's actually really easy to represent the notion of on or off.
但是最终,之前我们采用二进制,而不是十进制,主要是因为当我们用一台实体机器运行计算机时,这实际上很容易用开或者关的概念来表示。
Something with a decimal point and numbers thereafter.
也就是小数点后还有数字。
If I go back to that code from a moment ago, and I just rerun math3, notice how many places printed after the decimal point -- two?
如果刚才我回到那段代码中去,我们回到math3,请注意在小数点后面,会打印几位数呢--两位?
So it turns out there's a solution to this: If you need more precision, more digits after the decimal point than a float allows, what do you go for instead?
所以这里有一个解决方案:,如果你需要比float类型允许的更高精度,小数点后更多位数,那你该用什么取代它?
So unlike an int, this is the type of number that can have numbers after a decimal place.
所以,不同于int,这个类型的数字,可以有小数位。
If we need a 7, this is the ones column, the twos, fours, eights, so here are our columns and this was our decimal system a moment ago, and I wanna express the number 7 and the only digits 0 I now have access to are zero and one, whereas, in decimal, dec meaning 10.
如果你需要7,这是一位,二位,四位,八位,这是位数,刚才说的十进制的位数,我想表达7而且,只能采用数字1与,在十进制中,dec意思是十。
应用推荐