public function testMod() { $a = 1234; $b = '-1675975991242824637446753124775730765934920727574049172215445180465096172921808707643480960976619010162856846742450225672776411590632518780962349126898196'; $c = '115792089237316195423570985008687907853269984665640564039457584007908834671663'; $math = new BcEngine(); $gmp = new GmpEngine(); $this->assertEquals($gmp->mod($a, $a), $math->mod($a, $a)); $this->assertEquals($gmp->mod($a, $b), $math->mod($a, $b)); $this->assertEquals($gmp->mod($b, $c), $math->mod($b, $c)); }
public function testMod() { $a = 1234; $b = '-1675975991242824637446753124775730765934920727574049172215445180465096172921808707643480960976619010162856846742450225672776411590632518780962349126898196'; $c = '115792089237316195423570985008687907853269984665640564039457584007908834671663'; $math = new BcEngine(); $this->assertEquals(0, $math->mod($a, $a)); $this->assertEquals('1234', $math->mod($a, $b)); $this->assertEquals('14474011154664524427946373126085988481658748083205070504932198000988604333958', $math->mod($b, $c)); }