DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Round In Java

03.06.2006
| 2930 views |
  • submit to reddit
        
Math.ceil(1.1); //Returns 2
Math.ceil(1.9); //Returns 2

Math.floor(1.1); //Returns 1
Math.floor(1.9); //Returns 1