We have answer of your question!

100% solved queries, no empty question

Question: How to Round Up The Result Of Integer Division


0

Advertisement


I'm thinking in particular of how to display pagination controls, when using a language such as C# or Java.

If I have x items which I want to display in chunks of y per page, how many pages will be needed?

Question author Ian-nelson | Source

Answer


1


Advertisement


Found an elegant solution:

int pageCount = (records + recordsPerPage - 1) / recordsPerPage;

Source: Number Conversion, Roland Backhouse, 2001

Answer author Ian-nelson

Advertisement


Tickanswer.com is providing the only single recommended solution of the question How to Round Up The Result Of Integer Division under the categories i.e c# , java , math , . Our team of experts filter the best solution for you.

You may also add your answer!