Forum Stats

  • 3,722,436 Users
  • 2,244,308 Discussions
  • 7,849,835 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Why integer division of literals is always performed at run-time in Java?

Gennady Kuznetsov
Gennady Kuznetsov Member Posts: 4 Red Ribbon

Hi All!


Why Java compiler always generates IDIV instruction to perform INTEGER division of integer LITERALS at run-time instead of evaluate it at compile time (as it does for FP division)? Is there any reason? Where this behavior is described in documentation (IMHO JLS and JVMS does not state anything).


BR, Gennadiy

Answers

Sign In or Register to comment.