intdiv

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

abs

acos

acosh

asin

asinh

atan

atan2

atanh

base_convert

bindec

ceil

cos

cosh

decbin

dechex

decoct

deg2rad

exp

expm1

fdiv

floor

fmod

hexdec

hypot

is_finite

is_infinite

is_nan

log

log10

log1p

max

min

octdec

pi

pow

rad2deg

round

sin

sinh

sqrt

tan

tanh

PHP

Home Menu