mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-20 05:34:47 +00:00
Merge pull request #463 from mkilgore/fix-const-divide
Fix divide in CONST
This commit is contained in:
commit
74cc70b0c6
3 changed files with 7 additions and 7 deletions
|
@ -600,13 +600,8 @@ FUNCTION Factor&(exp$, state AS ParserState)
|
|||
ele$ = getnextelement$(exp$, state.index, state.strIndex)
|
||||
IF Unary&(exp$, state) = 0 THEN FixupErrorMessage state, "/": EXIT FUNCTION
|
||||
|
||||
IF (num.typ AND ISFLOAT) OR (state.num.typ AND ISFLOAT) THEN
|
||||
' Regular division is always done as floating-point
|
||||
ParseNumSetF num, FLOATTYPE - ISPOINTER, num.f / state.num.f
|
||||
ELSEIF (num.typ AND ISUNSIGNED) OR (state.num.typ AND ISUNSIGNED) THEN
|
||||
ParseNumSetUI num, UINTEGER64TYPE - ISPOINTER, num.ui / state.num.ui
|
||||
ELSE
|
||||
ParseNumSetI num, INTEGER64TYPE - ISPOINTER, num.i / state.num.i
|
||||
END IF
|
||||
ELSE
|
||||
IF CONST_EVAL_DEBUG THEN _Echo "Factor done!"
|
||||
state.num = num
|
||||
|
|
|
@ -47,6 +47,8 @@ CONST const__str4 = (const__str + (const__str2))
|
|||
|
||||
CONST const__unsignedint = 2~&& * 5~&&
|
||||
|
||||
CONST const__division_floating = 1& / 5&
|
||||
|
||||
PRINT const__OR
|
||||
PRINT const__AND
|
||||
PRINT const__NOT
|
||||
|
@ -91,4 +93,6 @@ PRINT const__str4
|
|||
|
||||
PRINT const__unsignedint
|
||||
|
||||
PRINT const__division_floating
|
||||
|
||||
SYSTEM
|
||||
|
|
|
@ -34,3 +34,4 @@ foobarfoobar2
|
|||
foobarfoobarfoobar2
|
||||
foobarfoobarfoobar2
|
||||
10
|
||||
.2
|
||||
|
|
Loading…
Reference in a new issue