I was wondering if there is a mathematical function for this:

If x is a decimal value, we subtract all decimal values from x and add 1.

Allow me to demonstrate:

1.00000000000001 = 2
2013.00123456789 = 2014
5.5 = 6
5.1 = 6
3.333333 = 4
7 = 7 <------ This is not a decimal value

If a math function does not exist for this, how do we mathematically do it?


It's called the ceiling function and is usually denoted by $\lceil x \rceil$.

  • $\begingroup$ Perfect answer! Thank you. I learned something new today! Oh how much I love learning. $\endgroup$ – CLearner Apr 19 '13 at 12:47
  • 1
    $\begingroup$ Before you agree that the ceiling is your answer, you should tell us what you want to happen for negative numbers. $\endgroup$ – GEdgar Apr 19 '13 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.