Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

issue with java calculator logic

d2d2d899-83af-4cd4-a092-27b20af0d27cMay 2 2019 — edited May 2 2019

HI

I am having a piece of code which does a simple division operation on double values . For example

  • 532/21 (25.33)
  • 8,470.56/21  (403.35)

The same can be verified with the sample java calculator downloaded from java tutorials website . I would like to know why there is a change in behaviour as in case 2 it should come as 403.36 instead of 403.55

Regards

Arun

Comments

Processing

Post Details

Added on May 2 2019
1 comment
137 views