类型提升有点类似于不同数据类型的转换,当两个数据之间类型不同时,若直接进行比较或赋值运算时会自动先将两个不同类型的数据均转化为其中的某种类型再进行操作,因此发生了类型提升。导致一些意外性让人茫然的错误。
有个专门的名词叫双目数值类型提升(binary numeric promotion) 在双目数值类型提升的情况下,如果任意一个操作数是 float 类型,那另外一个会被转换成为 float 类型;
基于12个网页-相关网页
... 类型描述符 deskryptor typu 类型提升 promocja typu 类型推理 wnioskowanie o typie ...
基于4个网页-相关网页
表达式的类型提升规则 type promotion rules
如果命名空间中的成员与某个模块成员同名,则对该模块成员的类型提升将会失效。
If the namespace already has a member with the same name as a module member, type promotion is defeated for that module member.
Mila和Oa已被培育此类型提升的人再三地粉碎,正是这个原因此类提升现在被禁止。
Mila and Oa have been shattered repeatedly by those fostering these types of ascension, and it is for this reason that they are now outlawed.
如果某个模块成员的类型提升失效,而您没有完全限定该成员,则无意中可能会访问另一个编程元素。
If type promotion is defeated for a module member and you do not fully qualify that member, you could inadvertently access a different programming element.
应用推荐