Modify

#3232 closed Bug (Fixed)

Issue when parsing scientific notation literals

Reported by: jchd18 Owned by: Jon
Milestone: 3.3.15.4 Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description (last modified by jchd18)

The runtime parser sometimes fails on reals in scientific notation immediately followed by some operators or silently gives a wrong result in some cases.

$x = 1e2 + 10
ConsoleWrite($x & @CRLF)	; 110 OK
$x = (1e2)+10
ConsoleWrite($x & @CRLF)	; 110 OK

$x = 1e2+10
ConsoleWrite($x & @CRLF)	; 100 Wrong!
$x = 1e2-10
ConsoleWrite($x & @CRLF)	; 100 Wrong!
$x = 1e2^10
ConsoleWrite($x & @CRLF)	; 1e+020 Wrong!
$x = 1e2+ 10			; Unable to parse line.
ConsoleWrite($x & @CRLF)
$x = 1e2- 10			; Unable to parse line.
ConsoleWrite($x & @CRLF)
$x = 1e2^ 10			; 1e+020 Wrong!
ConsoleWrite($x & @CRLF)

+, - and ̂ are the only arithmetic operators affected: * and / seem to work correctly. (It was fun composing the exponentiation sign here!)

Attachments (0)

Change History (8)

comment:1 by anonymous, on May 23, 2016 at 9:46:48 PM

If I run Tidy on those lines, I get the correct results.

comment:2 by jchd18, on May 24, 2016 at 9:07:20 AM

That's obvious, since tidying the code inserts whitespace between literals and operators, when needed, for readability. The bug remains that untidied code isn't parsed correctly or gives wrong results.

comment:3 by jchd18, on May 24, 2016 at 9:08:48 AM

Description: modified (diff)

comment:4 by J-Paul Mesnage, on Apr 3, 2018 at 3:29:01 PM

Owner: set to Jon
Status: newassigned

comment:5 by mLipok, on Jul 8, 2020 at 10:13:18 AM

for reference only
#3770

comment:6 by J-Paul Mesnage, on Jul 18, 2020 at 9:51:23 AM

I did a fix proposed to Jon

comment:7 by J-Paul Mesnage, on Aug 10, 2020 at 12:38:34 PM

Owner: changed from Jon to J-Paul Mesnage

comment:8 by Jon, on Jun 11, 2021 at 12:55:12 PM

Milestone: 3.3.15.4
Owner: changed from J-Paul Mesnage to Jon
Resolution: Fixed
Status: assignedclosed

Fixed by revision [12547] in version: 3.3.15.4

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.