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).
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)
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:
#455Taking into account the current state of the documentation ('Literals' documentation page), I think we can now close this bug report.
Thanks, fxm.
Fixed by documentation: https://www.freebasic.net/wiki/wikka.php?wakka=ProPgLiterals