This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

division by zero

Hi all,

Does anybody know what does the system do when a division by zero occurs?

We are running RTX 51 ful kernel on Philips' 80c51, 80c552 and 80c660 controllers.

Thanks,

Laurent.

Parents
  • A similar question came up here a few months ago because a particular chip returns a strange value (all bits set) from the math accelerator when a division by zero occurs. I believe the compiler returns a value of 0, but of course the real result is undefined.

    After some discussion, we determined that the math accelerator returns all bits set because this was fewer internal gates than returning 0's. And, division by 0 is undefined anyway, so...

    Don't rely on the results of a division by 0.

    Jon

Reply
  • A similar question came up here a few months ago because a particular chip returns a strange value (all bits set) from the math accelerator when a division by zero occurs. I believe the compiler returns a value of 0, but of course the real result is undefined.

    After some discussion, we determined that the math accelerator returns all bits set because this was fewer internal gates than returning 0's. And, division by 0 is undefined anyway, so...

    Don't rely on the results of a division by 0.

    Jon

Children