コード例 #1
0
ファイル: Module.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method returns the value as a IDouble. Note: Using this method may result in
  * lost of precision.
  *
  * @access public
  * @static
  * @param ITrit\Type $x                                     the object to be converted
  * @return IDouble\Type                                     the value as a IDouble
  */
 public static function toDouble(ITrit\Type $x) : IDouble\Type
 {
     return IDouble\Type::make($x->unbox());
 }
コード例 #2
0
ファイル: TypeTest.php プロジェクト: bluesnowman/fphp-saber
 /**
  * This method tests the "make" method.
  *
  * @dataProvider data_make
  */
 public function test_make(array $provided, array $expected)
 {
     $p0 = IDouble\Type::make($provided[0]);
     $this->assertInstanceOf('\\Saber\\Data\\IDouble\\Type', $p0);
     $p1 = $p0->unbox();
     $e1 = $expected[0];
     $this->assertInternalType('float', $p1);
     $this->assertSame($e1, $p1);
 }