Menu

#491 precision denotation suffix char returns syntax error

closed
v1ctor
compiler (247)
compiler
2019-06-16
2010-01-29
Dr_D
No

print 1d-(1)
print 1f-(1)

Discussion

  • Ebben

    Ebben - 2010-02-06

    Dr_D, not really a bug since d isn't a valid precision suffix (according to the wiki).
    This code works:

    print 102.568f-(1)

    This code doesn't:

    print 102.568d-(1) 'error 3: Expected End-of-Line, found '(' in 'print 102.568d-(1)'

    The QB style identifier for doubles works though (#)

    print 102.568#-(1)

     
  • dkl

    dkl - 2013-11-03

    Currently the d and e suffixes allow an optional +/- and an exponent to follow, and currently even just the +/- without any exponent digits is accepted (unless separated by spaces etc), see also [#455]. So the - is parsed as part of the number literal.

    The f suffix currently does not allow an exponent to follow, so the - isn't part of the number literal.

    I think the behaviour of d/e is following QB which allows exponents for both d and e, while f was an idea taken from C which doesn't allow exponents on f, only for e (and doesn't have d at all).

     

    Related

    Bugs: #455

  • fxm (freebasic.net)

    Taking into account the current state of the documentation ('Literals' documentation page), I think we can now close this bug report.

     
  • Jeff Marshall

    Jeff Marshall - 2019-06-16
    • status: open --> closed
    • Component: --> compiler
     

Log in to post a comment.

MongoDB Logo MongoDB