Problem is in PRINTL
It assumes that the expression to print is a string so parsing consider it as a string and not a number
Try this where I've included your numeric expressions into STR$(...) that assumes to parse a number and convert into a string
thinBasic is a real-time interpreter without any intermediate code.Uses "Console" printl "(-2)^2 =", str$((-2)^2) printl "-2^2 =", str$(-2^2) printl "-(2)^2 =", str$(-(2)^2) WaitKey
String parsing try to look ahead to check if next expression can be a numeric expression and not a string, switch into numeric parsing and at the end covert into a string.
But seems there is something to improve here.
Will have a look
Thanks
Bookmarks