# Math.round() ? please explain ?

mark stone

Ranch Hand

Posts: 417

Tarik Makota

Greenhorn

Posts: 23

posted 13 years ago

- 0

Basically:

Java Math.round() which by the way returns long always leans towards higher number in case of those in the midle like : 2.5, 3.5, -2.5, -3.5.

so if you have -5.5 first highest integer/non-decimal is -5.

if you have 6.5 it takes first highest integer which is 7.

Tarik

Java Math.round() which by the way returns long always leans towards higher number in case of those in the midle like : 2.5, 3.5, -2.5, -3.5.

so if you have -5.5 first highest integer/non-decimal is -5.

if you have 6.5 it takes first highest integer which is 7.

Tarik

sylvia weller

Greenhorn

Posts: 29

It is sorta covered in the JavaRanch Style Guide. |