/** * This method returns the value as a IFloat. Note: Using this method may result in * lost of precision. * * @access public * @static * @param ITrit\Type $x the object to be converted * @return IFloat\Type the value as a IFloat */ public static function toFloat(ITrit\Type $x) : IFloat\Type { return IFloat\Type::make($x->unbox()); }
/** * This method tests the "isNegative" method. * * @dataProvider data_isNegative */ public function test_isNegative(array $provided, array $expected) { $p0 = IFloat\Module::isNegative(IFloat\Type::box($provided[0])); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method tests the "toString" method. * * @dataProvider data_toString */ public function test_toString(array $provided, array $expected) { $p0 = IFloat\Type::box($provided[0])->toString(); $e0 = $expected[0]; $this->assertInstanceOf('\\Saber\\Data\\IString\\Type', $p0); $this->assertSame($e0, $p0->unbox()); }
/** * This method returns whether the operand is a negative number. * * @access public * @static * @param IFloat\Type $x the object to be evaluated * @return IBool\Type whether the operand is a negative * number */ public static function isNegative(IFloat\Type $x) : IBool\Type { return IBool\Type::box($x->unbox() < 0.0); }