MPC5744P LINFLEXD driver

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5744P LINFLEXD driver

399件の閲覧回数
ykp3036
Contributor I

In MPC5477P LINFLEXD driver, when compute  fraction baudrate, why plus "0.5F" in the end?

ykp3036_0-1677464188408.png

 

0 件の賞賛
2 返答(返信)

388件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the default float-to-integer conversion in C does not round to the nearest integer, but instead truncates fractional part. So rounding to the nearest integer can be achieved by adding 0.5 and then do a type cast.

BR, Petr

0 件の賞賛

383件の閲覧回数
ykp3036
Contributor I

thanks, 66666666666666

0 件の賞賛