本书中有大量的例子,从简单(加减操作符的重载)到复杂(重载数值常量以及运行时间等)一应俱全。
There are many examples covering the range from simple (addition/subtraction overloading) to the complex (overloading numeric constants and run-time overloading).
当您具有容易的方式来表达数值常量时,尤其是十六进制,就可以容易地构建对应于特定测试用例的标志,这是一种常见的编程技术。
When you have an easy way to express numeric literals, especially in hexadecimal, you can easily build flags that correspond to specific test cases, which is a common programming trick.
这个备受争议的发现来自一项科学观察,大自然中有一个常量似乎在宇宙的不同地区有着不同的数值。
The controversial finding comes from an observation that one of the constants of nature appears to be different in different parts of the cosmos.
作为程序的一部分,具有明确的数值称之为常量。
An explicit data value that appears as part of the program is called a constant.
需要显式常量或是“魔力值”的很多API都是API契约的一部分,这些常量或数值并不只是随意添加到代码中的(这里的意思指的是很多API中都拥有一些常量或是数值,他们是API契约所要求的,因此根据反编译后的结果很难推测出这些常量或数值所代表的含义——译者注)。
Many APIs that expect explicit constants or 'magic values' are part of an API contract and not merely some value added in to the code.
与数值类型相关的其他两个重点是常量(如上例中的100,只是明确表达的数字)和位运算。
Two other important points related to the numeric types are literals, which are just explicitly expressed Numbers, like 100 in the previous examples, and bit operations.
学者们通常是借助一个被称为“GMT常量”的数值,将古玛雅历法转换成公历(现代历法)。
To convert the ancient Mayan calendar to the Gregorian (or modern) calendar, scholars use a numerical value (called the GMT).
学者们通常是借助一个被称为“GMT常量”的数值,将古玛雅历法转换成公历(现代历法)。
To convert the ancient Mayan calendar to the Gregorian (or modern) calendar, scholars use a numerical value (called the GMT).
应用推荐