DDRM wrote: ↑Tue 12 Aug 2025, 09:46
It may simply be taking a block of bytes, and instead of interpreting every 4 bytes as a 32 bit integer it may be interpreting 5 (8? More?) as a float?
No, because if you simply transfer one array into another (with no actual array arithmetic taking place) the indexes / indices line up:
Code: Select all
DIM a(100), a%(100)
a%(50) = 76543
a() = a%()
PRINT a(50)
This prints
76543 which wouldn't be the case if there was a misalignment of the kind you suggest.
But if the right-hand-side is an array
expression it doesn't work as you would hope: it seems to coerce the result to the data type of the source array before copying it into the destination array. So if you do this:
Code: Select all
DIM a(100), a%(100)
a%(50) = 76543
a() = a%() * a%()
PRINT a(50)
it gives a 'Number is out of range' error when of course 76543^2
isn't out of range for the destination array. Put another way, it behaves as though internally it's doing this:
Code: Select all
DIM a(100), a%(100), tmp%(100)
a%(50) = 76543
tmp%() = a%() * a%()
a() = tmp%()
PRINT a(50)
which of course largely negates the potential value of the result array having a larger range than the source array(s).