Opened 9 years ago
Closed 3 years ago
#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 Changed 9 years ago by anonymous
comment:2 Changed 9 years ago by jchd18
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 Changed 9 years ago by jchd18
- Description modified (diff)
comment:4 Changed 7 years ago by Jpm
- Owner set to Jon
- Status changed from new to assigned
comment:5 Changed 4 years ago by mLipok
for reference only
#3770
comment:6 Changed 4 years ago by Jpm
I did a fix proposed to Jon
comment:7 Changed 4 years ago by Jpm
- Owner changed from Jon to Jpm
comment:8 Changed 3 years ago by Jon
- Milestone set to 3.3.15.4
- Owner changed from Jpm to Jon
- Resolution set to Fixed
- Status changed from assigned to closed
Fixed by revision [12547] in version: 3.3.15.4
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.
If I run Tidy on those lines, I get the correct results.