/** * This method tests the "toInteger" method. * * @dataProvider data_toInteger */ public function test_toInteger(array $provided, array $expected) { $p0 = IDouble\Module::toInteger(IDouble\Type::box($provided[0])); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IInteger\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method returns the value as an IInteger. Note: Using this method may result in * lost of precision. * * @access public * @static * @param IRatio\Type $x the object to be converted * @return IInteger\Type the value as an IInteger */ public static function toInteger(IRatio\Type $x) : IInteger\Type { return IDouble\Module::toInteger(IRatio\Module::toDouble($x)); }