LV So, this is functionally similar to a cast? What happens when the number being entiered doesn't fit into the size type? A bignum being cast into an int, for instance?escargo 29 Nov 2006 - It's more like the round function. I think the point is that however big the number might be, it will pick the smallest integral type that will hold it. See TIP 237 [1] for full details.DKF: It's unspecified what size of value you get beyond "big enough", and a bignum is big enough to take any integer you want (assuming you've got the memory to hold it...)Lars H: As a rounding function, this is unfortunately not particularly good. There a four common ways to round doubles to integers, three of which are useful:
- To nearest integer
- This is round.
- To smallest integer >= given number
- This has to be coded as round(ceil($x)).
- To greatest integer <= given number
- This has to be coded as round(floor($x)).
- Round towards zero
- A.k.a. truncating decimals. This is entier. Specified by the hideous inequality 1 > abs($x) - abs(entier($x)) >= 0.
