Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Division.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Framework\Math;
7 
14 class Division
15 {
19  const DIVIDE_EPSILON = 10000;
20 
28  public function getExactDivision($dividend, $divisor)
29  {
30  $epsilon = $divisor / self::DIVIDE_EPSILON;
31 
32  $remainder = fmod($dividend, $divisor);
33  if (abs($remainder - $divisor) < $epsilon || abs($remainder) < $epsilon) {
34  $remainder = 0;
35  }
36 
37  return $remainder;
38  }
39 }
getExactDivision($dividend, $divisor)
Definition: Division.php:28