Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

intdiv

Description

The intdiv Math for PHP integer division.

Syntax

intdiv ( int $dividend , int $divisor ) : int

Parameters

dividend

Number to be divided.

divisor

Number which divides the dividend.

Return

The integer quotient of the division of dividend by divisor.

Examples

1

<?

$dividend = -3;
$divisor = -2;

$return = intdiv($dividend, $divisor);

echo $return;

?>
1

2

<?

$dividend = -3;
$divisor = 2;

$return = intdiv($dividend, $divisor);

echo $return;

?>
-1

3

<?

$dividend = 3;
$divisor = -2;

$return = intdiv($dividend, $divisor);

echo $return;

?>
-1

4

<?

$dividend = 3;
$divisor = 2;

$return = intdiv($dividend, $divisor);

echo $return;

?>
1
HomeMenu