Rounding function insight

Simply the integral function is to take the integer part of a number. It is divided into rounded down and rounded up two types.

Rounding down mathematical notation: only the lower end of the curved brackets



It represents an integer taking a fractional part removed, i.e. x is an integer less than the maximum, in a computer programming language, typically represented by the function floor (x). Such as:. Floor (3.14) = 3, floor (-3.14) = -4 be appreciated that such a "floor indicates the floor is rounded down to the meaning of"

Roundup mathematical notation is: Only the upper end of the curved brackets 

It takes denotes the smallest integer larger than x. In the computer programming language is usually represented by the function ceil (x). Such as: ceil (3.14) = 4, ceil (-3.14) = -3.

Can be understood "denotes a ceiling ceiling is rounded up means"
Reference: http: //zh.wikipedia.org/wiki/%E5%8F%96%E6%95%B4%E5%87%BD%E6%95%B0 Application Reference "data structure" in the complete binary tree node the functional relationship between the number and depth of uses.
Published 46 original articles · won praise 7 · views 80000 +

Guess you like

Origin blog.csdn.net/yangbo_hr/article/details/2619416