Possible Duplicate:
C programming division
I'm trying to calculate the period of accelerometer updates using a user entered frequency.
this is my code:
double interval = 1/Freq;
interval = period
Freq is an int set by the user.
The problem I'm having is lets say I set Freq to 2Hz so the interval should be 0.5 but instead interval is 0.0000000 why is this? Can I do anything to change it without changing Freq to a double?