变量可以是前述每种转换类型的源和目标。
A variable can be a source and a target for each of the transform types described earlier.
在构建一个处理流时,也会遇到处理流中的某个变量需要转换类型的情况。
When building a process flow, there are also cases where a variable in the process flow needs to be converted from one type to another.
把包含原子值(数字、布尔值或字符串)的变量和另一个此类变量或者文字原子值比较,希望一种类型自动转换成另一种类型。
Comparing a variable having an atomic value (number, Boolean, or string) to another such variable or a literal atomic value, and expecting the type of one to be cast automatically to the other type.
简言之,这些方法的本质总是使您确信代码块内部的不变量会确保代码块中的任何类型强制转换都将成功。
In short, the moral to this story is to always convince yourself that the invariants inside a code block ensure that any casts in the block will always succeed.
然后,我们可以调用say函数,将myhouse变量的数据类型转换成“Talk”接口。
Then, we could call the say function, casting our myhouse variable to the "Talk" interface.
要从集合中提取元素,您必须知道集合中对象的类型,以将其强制转换为合适的局部变量。
To fetch elements from the collection, you had to know the type of object in the collection so you could cast it back to the appropriate local variable.
把类型强制转换当作一种断言,把不变量当做说明该断言为true的原因的参数。
Think of a cast as a kind of assertion and the invariants as arguments for why the assertion is true.
解决方案是将浮点变量的地址强制转换成一个指向整型类型的指针,如下所示。
The solution is to cast the address of the floating point variable to a pointer to an int, which is then de-referenced as shown below.
这意味着你可以直接在返回的对象上访问成员,或者可以使用强类型的局部变量为其赋值,而无需进行转换。
This means that you can easily access members directly off a returned object, or you can assign it to a strongly typed local variable without having to cast.
赋值、计算或数据类型转换的结果太大,以至于不能在那种类型变量允许的取值范围内表示。
The result of an assignment, calculation, or data type conversion is too large to be represented within the range of values allowed for that type of variable.
对于单变量的情况,本文讨论了两种动态模型:GARCH类型模型和状态转换模型。
For the univariate case, we discuss two kinds of dynamic models: GARCH type model and regime switching model.
该类型转换的方法是由包含在变量名之前的圆括号内的前缀变量类型来运行的。
The method of typecasting is done by prefixing the variable type enclosed by parenthesis before the variable name.
若要执行强制转换,请在要转换的值或变量前面的圆括号中指定要强制转换到的类型。
To perform a cast, specify the type that you are casting to in parentheses in front of the value or variable to be converted.
如果范围变量是显式类型的,请确保该类型与循环访问的集合中的元素类型相同或可从该类型隐式转换。
If the range variable is explicitly typed, make sure that the type is either the same as, or implicitly convertible from, the type of the elements in the collection it iterates.
始终使用原始数据类型(有时也称为字面量)来转换变量,这种没有任何额外的影响的做法反而效率更高。
Always use primitive data types (sometimes referred as literals) for converting variables. These won't do any extra tricks and they usually have better performance.
调用过程时使用扩大到对应参数类型的变量,从参数到变量的转换则为缩小转换。
A procedure is called with an argument that widens to the corresponding parameter type, and the conversion from the parameter to the argument is narrowing.
调用过程时使用扩大到对应参数类型的变量,从参数到变量的转换则为缩小转换。
A procedure is called with an argument that widens to the corresponding parameter type, and the conversion from the parameter to the argument is narrowing.
应用推荐