public function trunc($x)
    {
        $sign = $this->sign($x);
        switch ($sign) {
            case -1:
                return ceil($x);
            case 1:
                return floor($x);
            default:
                return $sign;
        }
    }
public function trunc($x)
    {
        $sign = $this->sign($x);
        switch ($sign) {
            case -1:
                return ceil($x);
            case 1:
                return floor($x);
            default:
                return $sign;
        }
    }
public function trunc ( $ x ) { $ sign = $ this -> sign ( $ x ) ; switch ( $ sign ) { case - 1 : return ceil ( $ x ) ; case 1 : return floor ( $ x ) ; default : return $ sign ; } }
Get the integral part of the given number by removing any fractional digits

This function doesn't round the given number but merely calls ceil(x) or floor(x) depending
on the sign of the number.

@param float $x A number
@return integer The integral part of the given number
Get the integral part of the given number by removing any fractional digits