src/Chippyash/Type/TypeFactory.php
public static function createFloat($value)
    {
        if ($value instanceof NumericTypeInterface) {
            return $value->asFloatType();
        }
        if (!is_numeric($value)) {
            throw new \InvalidArgumentException("'{$value}' is no valid numeric for FloatType");
        }
        
        if (self::getRequiredType() == self::TYPE_GMP) {
            return RationalTypeFactory::create($value);
        }
        
        return new FloatType($value);
    }
public static function createFloat($value)
    {
        if ($value instanceof NumericTypeInterface) {
            return $value->asFloatType();
        }
        if (!is_numeric($value)) {
            throw new \InvalidArgumentException("'{$value}' is no valid numeric for FloatType");
        }
        
        if (self::getRequiredType() == self::TYPE_GMP) {
            return RationalTypeFactory::create($value);
        }
        
        return new FloatType($value);
    }
public static function createFloat ( $ value ) { if ( $ value instanceof NumericTypeInterface ) { return $ value -> asFloatType ( ) ; } if ( ! is_numeric ( $ value ) ) { throw new \ InvalidArgumentException ( "'{$value}' is no valid numeric for FloatType" ) ; } if ( self :: getRequiredType ( ) == self :: TYPE_GMP ) { return RationalTypeFactory :: create ( $ value ) ; } return new FloatType ( $ value ) ; }
Create a FloatType

@param mixed $value
@return \Chippyash\Type\Number\FloatType|\Chippyash\Type\Number\Rational\GMPRationalType

@throws \InvalidArgumentException
Create a FloatType