Not directly related to the above fix, I spotted this:

Code: Select all

```
>PRINT 2*1024*1024*1024
Number is out of range
>PRINT 2147483647+2147483647
-2
>_
```

Obviously, that isn't right. And, I get the same results in Brandy 1.20.1 so it's not due to my modifications!

So, for simple additions, subtractions and multiplications, I'm promoting the LHS value to a float prior to performing any operations on them, so now we get the right answer.

I don't know how 6502 or ARM BBC BASIC, nor BBCSDL does it under the lid, however the above examples really shouldn't happen. I get the correct answers in RISC OS 3.71 (RPCEmu) and BBC BASIC 4 (BBC Master under emulation).

Edit: To clarify, I do NOT get these problems on any of the Acorn BASICs I've tested it on.

Edit 2: Richard Russell pointed out that Acorn's 8-bit BASICs, and I confirmed also RISC OS with the exception of BASIC VI, does this:

Code: Select all

```
>PRINT -2147483647 - 2147483647
2
>_
```

which is arguably very wrong.

Matrix Brandy and ARM BBC BASIC VI give the result as -4294967294.