如果我们回想一下我们一开始讲过的数据对象的种类,浮点数,整数,字符串,它们实际上有相同的行为方式。
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.
所以f不是已经是个浮点数了吗?
浮点数和双精度数字的二进制表示。
ebnf样式的浮点数描述。
最好完全避免使用浮点数比较。
It would be best to try to avoid floating point comparison entirely.
为什么需要用单独的宏进行浮点数比较?
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.
浮点数并不是实数。
坐标值是数字(小数、浮点数等),不是字符串。
The coordinate values are numeric (decimal, float, etc.), not character strings.
随着数字变大,它们之间的浮点数就会越来越少。
浮点数不是精确值,所以使用它们会导致舍入误差。
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.
“普通消费者不需要双精度(浮点数支持)”他说。
对于浮点数,您将在整数部分和小数部分之间放置小数点。
For floating-point Numbers, you place a decimal as the separator between the whole part of the number and the fraction.
NaN的无序性质使得在比较浮点数时更容易发生错误。
The non-ordered nature of NaN adds further opportunities for error when comparing floating point numbers.
Google提供清单9所示的宏以支持浮点数比较。
Google provides the macros shown in Listing 9 for floating point comparisons.
可以看到,对于比较小的2的幂次方,浮点数是非常精确的。
As you can see, floats are pretty accurate for small powers of two.
IEEE 754用科学记数法以底数为2的小数来表示浮点数。
IEEE 754 represents floating point Numbers as base 2 decimal Numbers in scientific notation.
否则,如果其中一个参数是浮点数,另一个也要转换成浮点数。
Otherwise, if either argument is a floating point number, the other is converted to floating point.
区别在于一个事实:计算机中使用的浮点数据类型无法包含每个实数。
The difference lies in the fact that floating-point data types used in computers can't hold every real number.
浮点数最好用来表示象测量值这类数值,这类值从一开始就不怎么精确。
Floating point Numbers are best reserved for values such as measurements, whose values are fundamentally inexact to begin with.
在第2部分,我将探讨专为操作浮点数(与抽象实数相反)而设计的函数。
In Part 2, I'll explore the functions more designed for operating on floating point Numbers as opposed to abstract real Numbers.
DECIMAL数据类型需要的存储空间通常要比浮点数据类型大得多。
The storage required for a DECIMAL data type is potentially much larger than it is for a normal floating-point data type.
CPhase的第一个参数是(经典的)浮点数,第二个参数是一个量子位。
CPhase takes a (classical) floating point number as its first argument and a qubit as it's second argument.
许多设计用来读取浮点数的例程可能会允许“NaN”(非数字)这样的值。
Many routines designed to read floats may allow values such as "NaN" (not a number).
许多设计用来读取浮点数的例程可能会允许“NaN”(非数字)这样的值。
Many routines designed to read floats may allow values such as "NaN" (not a number).
应用推荐