int x = number_of_items;
int y = items_per_page;
// with out library
int pages = x/y + (x % y > 0 ? 1 : 0)
// with library
int pages = (int)Math.Ceiling((double)x / (double)y);
public static int RoundedUpDivisionBy(this int @this, int divider)
{
var result = @this / divider;
if (@this % divider is 0) return result;
return result + Math.Sign(@this * divider);
}