Пример #1
0
 public function testMinMax()
 {
     $min;
     $max;
     CMathf::minMax(1.2, 2.8, $min, $max);
     $this->assertTrue($min === 1.2 && $max === 2.8);
     $min;
     $max;
     CMathf::minMax(-1.2, -2.8, $min, $max);
     $this->assertTrue($min === -2.8 && $max === -1.2);
     $min;
     $max;
     CMathf::minMax(1, 2, $min, $max);
     $this->assertTrue($min === 1.0 && $max === 2.0);
     $min;
     $max;
     CMathf::minMax(-1, -2, $min, $max);
     $this->assertTrue($min === -2.0 && $max === -1.0);
 }