# manipulating the remainder of a float

• 10-03-2006
thestien
manipulating the remainder of a float
hi im having a problem finding any stuff on the remainder of a float and how to use and seperate it form the int part of a float ie 8700/1200=7 remainder300
i was wondering if any one could post a few links or give me an idea of how this type of thing works.
• 10-03-2006
thestien
ok i just found something about using a % and a / to get the remainder?
if using a % and a / will alow me to store the remainder of a sum then could some one please just explain how to include it in the sum thank you again :)
• 10-03-2006
Cat
int quotient = 8700/1200; // Quotient = 7
int remainder = 8700 % 1200; // Remainder = 300
• 10-03-2006
zx-1
% doesn't work on reals, you must use fmod().
• 10-04-2006
thestien
ok thank you ill try and use the % thank you for your help
• 10-04-2006
thestien
yay thank you so much you just made my job so much easier.
now all i have to do is re write the new parts into my program ive just testes a small part and it already works so much more accuratly
again thank you