Understanding Division in Arduino C language


greetings, mighty hackers.

can explain why result of
code: [select]
serial.println(77/99); 0, instead of number between 0 , 1?


i'm guessing / means integer division? how divide in full (non integer way)?

many thanks

first, not "arduino c language", c language.  period.  same other c language.

google integer arithmetic.  definition, integers whole numbers only: 1, 2, 3, etc.  if want floating point result, use floating point variables.  arithmetic slower, , consume more memory, both flash , ram.

regards,
ray l.


Arduino Forum > Using Arduino > Programming Questions > Understanding Division in Arduino C language


arduino

Comments