floor
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Round fractions down
floor
(
int
|
float $num
):
float
public function
sliding
(
$size
=
2
,
$step
=
1
)
{
$chunks
=
floor
((
$this
->
count
() -
$size
) /
$step
) +
1
;
return static::
times
(
$chunks
, function (
$number
) use (
$size
,
$step
) {
return
$this
->
slice
((
$number
-
1
) *
$step
,
$size
);
src/Illuminate/Collections/Collection.php
$groups
= new static;
$groupSize
=
floor
(
$this
->
count
() /
$numberOfGroups
);
$remain
=
$this
->
count
() %
$numberOfGroups
;
src/Illuminate/Collections/Collection.php