Search:

Type: Posts; User: curmudgeon

Search: Search took 0.09 seconds.

  1. Replies
    4
    Views
    7,311

    [SOLVED] Re: Why is in Java 9/2=4 ??

    Thanks for the correction Z.
  2. Replies
    4
    Views
    7,311

    [SOLVED] Re: Why is in Java 9/2=4 ??

    You're doing int division which always returns an int (truncated to the nearest int). If you want a double result, you have to use at least one double in your statement:



    double result = 9.0 /...
Results 1 to 2 of 2