A division of 2 integers should not yield an integer by default. It would be better to return a float value by default, except when the targeted variable (lhs/param) is known to be integer.

So I don’t need to cast to float explicitly:
(query.resultSize().floatValue() / resultsPerPage.floatValue()).ceil()

Submitted by Elmer van Chastelet on 13 April 2011 at 17:32

Log in to post comments