1

We know that:

(1) java could handle DivideByZero ArithmeticException gracefully.

(2) C/c++ language cannot handle this, unless we use system-level error handling----like on linux, we need to set up signal handler to process SIGFPE, and then continue.

So my question is: how jvm implements internally, when a DivideByZero case occurs, is this just like that, the floating point error is detected by operating system, a signal is sent to jvm, and jvm transfers this signal handler into a java exception for client code?

Just a guess, is there any explanation from jvm principals? Thanks.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Hind Forsum
  • 9,717
  • 13
  • 63
  • 119

0 Answers0