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