neilsf/XC-BASIC

Invert sign of a numeric variable

Closed this issue · 2 comments

If i use this syntax :
let v=1
let v=-v

Compiler return an error like this:
failure at line 1, col 5, after " v=1\nlet v" expected "anything but "=""

the workaround is :
let v=1
let v=0-v

exists a more elegant way or is this the right way ?

The unary - operator was dropped somewhere in version 0.9 and has not been re-implemented since.
Hopefully I can add it again in version 3.

Duplicate of #40