示例#1
0
文件: Number.php 项目: enimiste/math
 /**
  * Check if this number is less than the given value
  *
  * @param string|int|float|Number $other
  *
  * @param int                     $scale
  *
  * @return bool
  */
 public function lt($other, $scale = null)
 {
     if (!$other instanceof Number) {
         if (!is_numeric($other)) {
             return false;
         } elseif (IntegerNumber::isInt($other)) {
             $other = new IntegerNumber($other);
         } else {
             $other = new FloatNumber($other, is_null($scale) ? FloatNumber::PRECISION : $scale);
         }
     }
     return $this->_lt($other);
 }
示例#2
0
 /**
  * @test
  * @dataProvider is_int_values
  */
 public function is_int_values_test($i, $expected)
 {
     $this->assertEquals($expected, IN::isInt($i));
 }
示例#3
0
 /**
  * @param string|int|float $value
  *
  * @return bool
  */
 function check_is_integer($value)
 {
     return \Enimiste\Math\VO\IntegerNumber::isInt($value);
 }