int a {500};
unsigned b { 1000 } ;
std: : cout<< a- b<< std: :endl ;//输出值不为500
int 被隐式转换为unsigned int
优先级高到低
long double
double
float
unsigned long long
long long
unsigned long
unsigned long
unsigned int
int
c++ static_ cast< 目标类型>(要转换的内容) int a=static cast<int>(b);
c 类型(要转换的内容) int a=int(b);
浮点数
float a{ 65923600.0}, b{ .00001},c{a+ b};
c=?;//c=a
浮点数运算需要对阶 小阶向大阶对齐 对阶过程中b的精度丢失即b=0