numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
17 stars 5 forks source link

Num2Str parser cannot handle floating point literals #176

Closed numeredev closed 4 months ago

numeredev commented 5 months ago

DESCRIPTION

Describe the bug If the num2str parser (#) is applied to a floating point value literal (like 1.234e+12), then it fails.

To Reproduce Steps to reproduce the behavior: Execute this line #1.234e+12

Expected behavior The floating point value is correctly parsed to a string.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

(Do not write below this line)


DEVS' SECTION

ANALYSIS

The problem originates from the simple usage of getPositionOfFirstDelimiter() within StringParser::numToString(). This function will return the next operator's position ignoring DIGIT e +/- DIGIT patterns which are typically used for floating point numbers. The same is true for complex numbers. Those will likely also not be parsed correctly.

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST