Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Math.floor() and Math.ceil()

 
Josh Mickley
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am beginning this thread because I am curious to find out why:

and


return doubles as opposed to ints. What was the rationale behind this decision? All input is welcomed...
 
Josh Mickley
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, after giving this further thought, I believe the reason double is returned is to support larger numbers. (Since the int primitive type is limited to 32 bits)
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!