关于类型转换和整数提升的有关问题

关于类型转换和整数提升的问题
在C++ primer上面有:
3.14159 + 'a' ; //promote 'a ' to int, then convert to long double
cval + fval ; //cval promoted to int, that int converted to float
cavl + lval ; //cavl converted to long
对这三个例子我不是很理解,宽度比int小的,在算数运算时,自动提升为int型,但是在和宽度比int型大的数做算数运算时,也是先提升再转换,再运算吗??中间有几个临时变量?

那cavl + lval ; //cavl converted to long 为什么不先整数提升呢?


------解决方案--------------------
有浮点数的时候,才需要多次提升。

引用:
在C++ primer上面有:
3.14159 + 'a' ; //promote 'a ' to int, then convert to long double
cval + fval ; //cval promoted to int, that int converted to float
cavl + lval ; //cavl converted to long
对这三个例子我不是很理解,宽度比int小的,在算数运算时,自动提升为int型,但是在和宽度比int型大的数做算数运算时,也是先提升再转换,再运算吗??中间有几个临时变量?

那cavl + lval ; //cavl converted to long 为什么不先整数提升呢?

------解决方案--------------------
不会,编译器在帮忙处理的。

引用:
Quote: 引用:

有浮点数的时候,才需要多次提升。

Quote: 引用:

在C++ primer上面有:
3.14159 + 'a' ; //promote 'a ' to int, then convert to long double
cval + fval ; //cval promoted to int, that int converted to float
cavl + lval ; //cavl converted to long
对这三个例子我不是很理解,宽度比int小的,在算数运算时,自动提升为int型,但是在和宽度比int型大的数做算数运算时,也是先提升再转换,再运算吗??中间有几个临时变量?

那cavl + lval ; //cavl converted to long 为什么不先整数提升呢?

多此提升的过程中,会产生多个临时变量么?