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