/** * 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()); }
/** * 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); }