daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

Float literals in scientific notation #659

Closed pdamme closed 6 months ago

pdamme commented 9 months ago

Currently, DaphneDSL supports float literals only of the form 123.4567, plus some special cases like inf and nan. 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 becomes 1e5 and 0.000001 becomes 1e-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:

AlexRTer commented 8 months ago

I would like to work on this issue.

pdamme commented 8 months ago

Thanks, go ahead!

AlexRTer commented 8 months ago

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++.

pdamme commented 8 months ago

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.