Hi, Charles
IF the result of an addition or multiplication is smaller than one of its terms ... there was an overflow !!!
an so on ...
Alain
Hi, Charles
IF the result of an addition or multiplication is smaller than one of its terms ... there was an overflow !!!
an so on ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Euh... lower than the Higher term is probably better IMHO Asumming 1*10, 10*10000, etc
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
And WHAT's wrong then, Mr Super E ??????????????????????????Originally Posted by mister_e
Cheers !!!
Alain
Last edited by Acetronics2; - 12th October 2006 at 13:38.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Makes me wonder why I didn't think of this before!
Charles Linquist
[quote]Makes me wonder why I didn't think of this before!{/quote]
Actually, I wonder why the authors of PBP didn't think of this in the first place, and set a readable flag that would indicate an overflow/underflow condition.
Hi, Ernie
Just because you're supposed to think to everything happening ... and of course because you're an " up to the top " PbP programmer ...
...
Thinking to that ... there's a CARRY BIT that exists in PICS ... I bet 1$ it is not automatically cleared by PbP ( ... ) in an overflow situation.
Just an idea ...
regards
Alain
Last edited by Acetronics2; - 12th October 2006 at 16:38.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Go ahead and bet your dollar. I'm using PBP for software in a human patient connected device. If my device fails to work when it's supposed to that person will die.I bet 1$ it is not automatically cleared by PBP ( ... ) in an overflow situation.
You can bet your buck but I'm not betting someone's life on an undocumented "feature."
I do code very defensively when using integer math; typically checking inputs for values in the expected range to keep the output from overflowing is sufficient.
Bookmarks