如果我们回想一下我们一开始讲过的数据对象的种类,浮点数,整数,字符串,它们实际上有相同的行为方式。
If we go back up to the kinds of data objects we started with, floats, ints, strings, they actually behave the same way.
它只是返回一个表示温度的浮点数。
All it does is return a floating point number representing the temperature.
最好完全避免使用浮点数比较。
It would be best to try to avoid floating point comparison entirely.
所以f不是已经是个浮点数了吗?
ebnf样式的浮点数描述。
为什么需要用单独的宏进行浮点数比较?
Why do you need separate macros for floating point comparisons?
那将会给我们一个浮点数。
还可以使用指数表示浮点数,参见清单8。
Floats can also be expressed using exponents, as shown Listing 8.
它就给我一个浮点数。
浮点数:一个浮点数。
但浮点数则不是这样。
简单类型包括字符串、浮点数、整数、枚举等。
Simple types include string, float, integer, enumeration, etc.
浮点数并不是实数。
如果您读取的浮点数,还有另外需要关注的问题。
If you're reading a floating point number, there are other concerns.
坐标值是数字(小数、浮点数等),不是字符串。
The coordinate values are numeric (decimal, float, etc.), not character strings.
随着数字变大,它们之间的浮点数就会越来越少。
所以我可以通过改变其中一个,整型数为浮点数。
And I can fix this just by changing one of those values to a floating point.
浮点数不是精确值,所以使用它们会导致舍入误差。
Floating point Numbers are not exact, and manipulating them will result in rounding errors.
适应性公式返回的是介于0和1之间的一个浮点数。
The fitness formula should return a floating point number between 0 and 1.
“普通消费者不需要双精度(浮点数支持)”他说。
我想确保这儿我得到的是一个浮点数,我该怎么做呢?
I can't rely on the user. I want to make sure I get a float in it, so how do I do that?
正如你希望的我要试着把他们转化为浮点数,等一等。
And as you might expect, I'm going to then try and see if I can convert that into a float.
对于浮点数,您将在整数部分和小数部分之间放置小数点。
For floating-point Numbers, you place a decimal as the separator between the whole part of the number and the fraction.
当然,这并不总是可能的,但您应该意识到要限制浮点数比较。
This is, of course, not always possible, but you should be aware of the limitations of floating point comparison.
IEEE 754用科学记数法以底数为2的小数来表示浮点数。
IEEE 754 represents floating point Numbers as base 2 decimal Numbers in scientific notation.
区别在于一个事实:计算机中使用的浮点数据类型无法包含每个实数。
The difference lies in the fact that floating-point data types used in computers can't hold every real number.
由有限精度浮点数字引起的很小的舍入错误就会严重歪曲数学精度计算。
Mathematically precise calculations can be thrown severely askew by small round-off errors caused by finite-precision floating-point Numbers.
浮点数最好用来表示象测量值这类数值,这类值从一开始就不怎么精确。
Floating point Numbers are best reserved for values such as measurements, whose values are fundamentally inexact to begin with.
DECIMAL数据类型需要的存储空间通常要比浮点数据类型大得多。
The storage required for a DECIMAL data type is potentially much larger than it is for a normal floating-point data type.
DECIMAL数据类型需要的存储空间通常要比浮点数据类型大得多。
The storage required for a DECIMAL data type is potentially much larger than it is for a normal floating-point data type.
应用推荐