浮點數(shù)的乘法運算步驟 C語言整數(shù)能和浮點數(shù)相乘嗎?
C語言整數(shù)能和浮點數(shù)相乘嗎?是,例如:int a=2flot B=4 double C=0 C=a*B//整數(shù)與小數(shù)相乘將轉(zhuǎn)換為double int d=0 d=(int)(a*B)//強制整數(shù)轉(zhuǎn)換,
C語言整數(shù)能和浮點數(shù)相乘嗎?
是,例如:int a=2flot B=4 double C=0 C=a*B//整數(shù)與小數(shù)相乘將轉(zhuǎn)換為double int d=0 d=(int)(a*B)//強制整數(shù)轉(zhuǎn)換,否則將報告錯誤