PHP intdiv() FunctionThe intdiv() is PHP mathematical function of PHP, which is used to calculate integer division. It returns the integer quotient of the division of dividend by divisor. Syntax:
Example 1Output: Your Number is : (3,2) int(1) : is Output value Example 2Output: Your Number is : (-3,2) int(-1) : is Output value Example 3Output: Your Number is : (3,-2) int(-1) : is Output value Example 4Output: Your Number is : (-3,-2) int(1) : is Output value Example 5Output: Your given value is : (PHP_INT_MAX, PHP_INT_MAX) int(1) : is your Output value Example 6Output: Your given value is : (PHP_INT_MIN, PHP_INT_MIN) int(1) : is your Output value Example 7Output: Your given value is : (PHP_INT_MIN, -1) Fatal error: Uncaught ArithmeticError: Division of PHP_INT_MIN by -1 is not an integer Example 8Output: Your given value is : (1,0) Fatal error: Uncaught DivisionByZeroError: Division by zero
Next TopicPHP Math
|