We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Bug fact: Following code cannot get right results.
#include "SST89x5xxRD2.H" signed char x,y,z; void main() { x = -15; y = x / 4; z = x % 4; while(1); }
y = -4 and z = -3, while y should be -3...
Reason: Compiler automatically generates RRC for division by power of 2. For a SIGNED CHAR, this could produce unexpected rounding results.
Solution: If a signed char is divided by power of 2, DO NOT use RRC in this case.