HH\Lib\Math\floor

Meta Engineer?

This is available as Math\floor in the www repository.

Returns the largest integer value less than or equal to $value

namespace HH\Lib\Math;

function floor(
  num $value,
): float;
  • To find the smallest integer value greater than or equal to $value, see Math\ceil().
  • To find the largest integer value less than or equal to a ratio, see Math\int_div().

Parameters

  • num $value

Returns

  • float

Examples

$floor1 = Math\floor(4.7);
echo "Floor of 4.7 is $floor1 \n";

$floor2 = Math\floor(5);
echo "Floor or 5 is $floor2 \n";