PHP how the data is rounded up

PHP how the data is rounded up?

PHP data may be rounded up () function is implemented by ceil, ceil () denotes a function rounded up to the nearest integer.

The syntax is:

1

ceil(x)

parameter

x Required. A number.

Explanation

Returns the next highest integer x, x if there is a fractional part proceeds. ceil () returns the type of still float, because the value range of float is usually bigger than the integer.

Example:

Rounding up, there is a decimal incremented 1: ceil ()

Returns the next highest integer value of a, value if there is a fractional part proceeds.

This method, when we write the page class is often used to calculate the number of pages.

1

2

ceil(3.14159); // 4

ceil(3.64159); // 4

What are the reasons "marble slab" marble slab measuring error of?

 

Guess you like

Origin www.cnblogs.com/furuihua/p/11535858.html