private static function toFloat($x)
    {
        if (is_float($x)) return $x;
        if (is_int($x)) return $x;
        if (is_string($x)) {
            $r = Rational::parse($x);
            return $r->p/$r->q;
        }
        throw new SyntaxErrorException();
    }
private static function toFloat($x)
    {
        if (is_float($x)) return $x;
        if (is_int($x)) return $x;
        if (is_string($x)) {
            $r = Rational::parse($x);
            return $r->p/$r->q;
        }
        throw new SyntaxErrorException();
    }
private static function toFloat ( $ x ) { if ( is_float ( $ x ) ) return $ x ; if ( is_int ( $ x ) ) return $ x ; if ( is_string ( $ x ) ) { $ r = Rational :: parse ( $ x ) ; return $ r -> p / $ r -> q ; } throw new SyntaxErrorException ( ) ; }
convert data to a floating point number, if possible


@param mixed $value (float, int, Rational)
@throws SyntaxErrorException if the string cannot be parsed
@retval float
convert data to a floating point number if possible