public function testGreaterThan() { $l = '3845987346534875'; $r = '2387432479223'; $this->assertTrue(Number::greaterThan($l, $r)); $l = '2387432479223'; $r = '3845987346534875'; $this->assertFalse(Number::greaterThan($l, $r)); $l = '3845987346534875'; $r = '3845987346534875'; $this->assertFalse(Number::greaterThan($l, $r)); }
/** * Returns the maximum value of this list. Result is undefined * for non numeric lists. * @return string * @throws \UnderflowException */ public function max() { if ($this->isEmpty()) { throw new \UnderflowException(\get_called_class() . ' is empty'); } $max = $this->front(); for ($i = 1, $l = $this->count(); $i < $l; ++$i) { if (Number::greaterThan($this->_Arr[$i], $max)) { $max = $this->_Arr[$i]; } } return $max; }