Good personal later
I'm having a problem in the calculation below, the result is coming out wrong,
signed long int xdata Resultado;
Resultado = 512;
Resultado = Resultado * EEPROM93xx_read( DesenhoCamadas );
// Resultado * 50 = 25600
Resultado = Resultado + ( EEPROM93xx_read( DesenhoAjuste ) - 100 ); //
Resultado + ( 86 - 100 ) = 25586
Resultado = (long)(Resultado) * (long)(4) / (long)(5);
// Resultado * 4 / 5 = 7361 *** ERROR OCCURS HERE *** - This 7361
returning, as if he were doing the calculation using variables of type int.
Can anyone give me a hand.
hugs
Ricardo
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user