/** * Find the modulus of two numbers * * @param mixed $operant * @param mixed $modulus * @return Number */ public static function modulus($operand, $modulus) { $operand = new AnyNumber($operand); $modulus = new AnyNumber($modulus); $command = new ModulusCommand($operand, $modulus); return $command->run(); }
/** @test */ public function should_find_the_modulus_of_two_numbers() { $command = new ModulusCommand(new AnyNumber(242342.4532), new AnyNumber(44.6643)); $total = $command->run(); $this->assertInstanceOf('PhilipBrown\\Math\\Number', $total); $this->assertEquals(34, $total->value()); }