hi,
i'm trying to display result of a simple math calcultation on 5-digit 7-segment display.
my display code is absouletly correct. but problem is in math equation.
I'm using 89c52 controller and doing coding in Keil C51.
here's the part of code which isn't working properly:
unsigned long int result;
result = 16.80*100;
the display shows 1679 whereas it should be 1680.
i tried :
unsigned long int result;
result = (unsigned long int)(16.80*100);
but sill the same result.
how can i solve the problem?
thanks in advance,
regards,
Neelam
i'm trying to display result of a simple math calcultation on 5-digit 7-segment display.
my display code is absouletly correct. but problem is in math equation.
I'm using 89c52 controller and doing coding in Keil C51.
here's the part of code which isn't working properly:
unsigned long int result;
result = 16.80*100;
the display shows 1679 whereas it should be 1680.
i tried :
unsigned long int result;
result = (unsigned long int)(16.80*100);
but sill the same result.
how can i solve the problem?
thanks in advance,
regards,
Neelam