mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-04 04:50:22 +00:00
Fix to Mod and \ in CONST
As per the sample code below: Const a = 5 Mod 2.8 Const b = 5 \ 2.8 Print a; "="; 5 Mod 2.8 Print b; "="; 5 \ 2.8 Old output was wrong. Patch should make the CONST values the same as what QB64 normally generates for us.
This commit is contained in:
parent
ca38a08ce7
commit
1a7e9dd959
|
@ -24634,19 +24634,19 @@ FUNCTION EvaluateNumbers$ (p, num() AS STRING)
|
|||
EXIT FUNCTION
|
||||
END IF
|
||||
CASE "\"
|
||||
IF FIX(VAL(num(2))) = 0 THEN
|
||||
IF VAL(num(2)) = 0 THEN
|
||||
EvaluateNumbers$ = "ERROR - Division By Zero"
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
||||
n1 = VAL(num(1)) \ FIX(VAL(num(2)))
|
||||
n1 = VAL(num(1)) \ VAL(num(2))
|
||||
CASE "MOD"
|
||||
IF FIX(VAL(num(2))) = 0 THEN
|
||||
IF VAL(num(2)) = 0 THEN
|
||||
EvaluateNumbers$ = "ERROR - Division By Zero"
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
||||
n1 = VAL(num(1)) MOD FIX(VAL(num(2)))
|
||||
n1 = VAL(num(1)) MOD VAL(num(2))
|
||||
|
||||
CASE "+": n1 = VAL(num(1)) + VAL(num(2))
|
||||
CASE "-":
|
||||
|
|
Loading…
Reference in a new issue