I would expect so, the same bug exists in Brandy 1.20.1 (the latest Sourceforge release), I have not tried Napoleon Brandy.
BASIC V gives "Number too big" at the "b=INT(a)" line, and my copy of BASIC64 (ARM BBC BASIC VI (FPA) 1.75, 03 March 2018) gives "Floating point exception: invalid operation" at the same instruction.RichardRussell wrote: ↑Tue Jul 16, 2019 5:57 pmThose implementations of BBC BASIC (that is up to and including ARM BASIC 5) use 40-bit floats with a 32-bit mantissa. So although the range of integers which can be stored in a floating-point variable is greater than what can be stored in an integer variable (by a factor of two) it's arguable - and indeed Acorn did successfully argue - that it's reasonable to limit the range of values accepted by INT to -2^31 to +2^31-1. If you supply a value outside of this range you get a 'Number too big' error.INT was accepting values that were out of range (which is not allowed on the BBC Micro nor RISC OS BBC BASIC implementations).
However in ARM BASIC 6 and Brandy floating-point variables are 64-bit doubles, which can contain a much larger integer (53-bits rather than 32). In that situation I don't think it's possible to argue that such a restriction is acceptable: you may well want to truncate to an integer a value much larger than 2^31 and the INT function should support doing that.
Here's a simple program to try on any BASIC that has floating-point variables with 64-bits or more:
This should print '0.5'. If it doesn't I would say something is seriously wrong.
Code: Select all
a = 2^50 + 0.5 b = INT(a) PRINT a - b