I'm trying to trouble shoot some code and this has me stumped...
_______________________________________________________________
/* Given the desired digits supplied by left_digit and right_digit, force the */
/* other digits outside of this range to zero. */
unsigned long trim_digits (unsigned long freq) {
unsigned long temp = freq;
/* Check that freq >= 12 and < 20000*100 */
if (temp < 12) {
temp = 12;
}
if (temp > (20000uL*100)) {
temp = 20000uL*100;
}
/* Trim digits to left of left_digit */
temp = temp % pow_ten[left_digit+1];
/* Trim digits to right of right_digit */
temp = temp / pow_ten[right_digit];
temp = temp * pow_ten[right_digit];
/* Check that freq >= 12 and < 20000*100 */
if (temp < 12) {
temp = 12;
}
if (temp > (20000uL*100)) {
temp = 20000uL*100;
}
__________________________________________________ _______
temp is to be either 12 or 20000uL*100 then trim the digits then put it right back to 12 or 20000uL*100?
It's been a while since I programmed and my current programming interest is Python but this has me stumped...
So no change is made to temp other then setting it to 12 or 20000uL*100?
The trim digits is nullified is it not?
Sorry if it's a stupid question I must be missing something really easy lol

