Re: An(other) BASIC bug



On May 22, 3:43 pm, "n...@xxxxxxxxxxxxxxx" <n...@xxxxxxxxxxxxxxx>
wrote:

<snip>


Amazing! And what is doubly amazing is that Brandy makes the same
mistake (did Dave Daniels have some inside knowledge of the workings
of the ARM interpreter?). You will be pleased to hear (and I was
pleased to find) that BBC BASIC for Windows gets it right.

Well actually that depends. If you're implementing something that
claims to be BBC BASIC it should, well, behave like BBC BASIC. So if
Brandy behaves the same it *is* behaving correctly.

Yes technically it's wrong that the number should become negative -
it's an overflow and yes the V flag gets set. But *checking* the V
flag (and flagging the error) would impact on performance. I'd imagine
that Integers are often just used as "counters" rather than for pure
arithmetic use - if you want accuracy (of sign that is) you'd opt for
floating point. Handling FP always has a speed cost so not checking
the sign wouldn't save you much... Int on the other hand that's a
different ballgame.


Is there a list of bugs in ARM BASIC (of this seriousness) anywhere?

This is *not* a bug but a design decission. I would agree though that
it should be well highlighted to users - who if they're doing
arithmetic involving *large* numbers should limit themselves to using
FP numbers - for small arithmetic or counting Int would do fine.


Richard.http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.

Regards

Annraoi

.



Relevant Pages


Loading