if i type 8 and 3 the result is 2 .
if i changed the one of the baby function argument to float it works fine(2.66667).why this code doesn't work properly with cast tranform ( f=(float)(x/y))
i want to do PIC microcontroler programming with C language and i want to decrease my variable bit.
if i type 8 and 3 the result is 2 .
if i changed the one of the baby function argument to float it works fine(2.66667).why this code doesn't work properly with cast tranform ( f=(float)(x/y))
Because first you divide integers (8/3) and you get 2, which is wrong. Then you cast it to float, but the result is wrong already. You must divide float values from the beginning. Try this and post back the results: