Here you can find the source of ceilingHalf(int num)
Parameter | Description |
---|---|
num | Input number |
public static int ceilingHalf(int num)
//package com.java2s; //License from project: Open Source License public class Main { /**//from www.j a va 2 s. c o m * Returns the ceiling of the half of the input value * * @param num Input number * @return Ceiling of the half of the input number */ public static int ceilingHalf(int num) { if ((num & 1) == 1) { return (num + 1) / 2; } else { return num / 2; } } }