/** * This method returns the numerically lowest value. * * @access public * @static * @param IUnit\Type $x the left operand * @param IUnit\Type $y the right operand * @return IUnit\Type the minimum value */ public static function min(IUnit\Type $x, IUnit\Type $y) : IUnit\Type { return IUnit\Module::compare($x, $y)->unbox() <= 0 ? $x : $y; }
/** * This method tests the "compare" method. */ public function test_compare() { $p0 = IUnit\Module::compare(IUnit\Type::instance(), IUnit\Type::instance()); $e0 = 0; $this->assertInstanceOf('\\Saber\\Data\\ITrit\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }