Closed pdamme closed 6 months ago
I would like to work on this issue.
Thanks, go ahead!
Are there any plans for adding digit separators to DaphneDSL yet? I think they would further improve readability for large numbers just like scientific notation does in some cases. Specifically, I'm thinking of adding _
and '
(e.g. 1_000_000
and 1'000'000
) which are used e.g. by Python and C++.
As far as I know, there were no concrete plans for digit separators yet, but it sounds like a good idea to me. Feel free to implement that as well, if it doesn't take too much time.
Currently, DaphneDSL supports float literals only of the form
123.4567
, plus some special cases likeinf
andnan
. However, floating-point numbers are also commonly expressed in the scientific notation, e.g.1.234567e2
. This notation is especially convenient for writing very small or very large numbers, e.g.,10000
becomes1e5
and0.000001
becomes1e-6
(there could be far more zeros).This task is to support the scientific notation in DaphneDSL, in addition to the currently supported floating-point notations.
Hints:
#659
in the code base (especially inscripts/algorithms/
), several points where the scientific notation should be used are marked that way.