Menu

#11 Doesn't like .001

closed
5
2003-12-23
2003-12-22
No

if (x < .001) {
// do something
}

compiles fine under javac, but chokes on Janino. The
workaround is to use "0.001"

MyClass.java, Line 1019, Column 20: Unexpected
token "." in primary
at net.janino.Parser.throwParseException(Unknown
Source)
at net.janino.Parser.parsePrimary(Unknown Source)
at net.janino.Parser.parseUnaryExpression
(Unknown Source)
at net.janino.Parser.parseMultiplicativeExpression
(Unknown Source)
at net.janino.Parser.parseAdditiveExpression
(Unknown Source)
at net.janino.Parser.parseShiftExpression(Unknown
Source)

Discussion

  • Arno Unkrig

    Arno Unkrig - 2003-12-23
    • status: open --> closed
     
  • Arno Unkrig

    Arno Unkrig - 2003-12-23

    Logged In: YES
    user_id=865893

    Yep... I never liked the ".001" style for floating-point
    constants. It looks ugly and is difficult to scan (the dot
    can either be the beginning of a floating-point constant or
    the "." operator). But for the sake of JAVAC
    compatibility... will be fixed in version 1.0.7.

     

Log in to post a comment.

MongoDB Logo MongoDB