06-20-2012, 09:17 PM
I recently discovered ZX Basis Compiler and this forum and it brought back some memories off the days that i owned and used a ZX Spectrum (48k and later a 128k) . I have collected some emulators over the years so i tried to compile some programs, one off witch made a little drawing using some calculation, it look a little different from the normal basic version.
It comes down to converting a float to a integer.
INT 3.9 gives 3 in normal basic and compiled
INT -3.9 in normal basic this is -4 but compiled the answer is -3
The correct answer is -4 according to the ZX basic manual (and also according other programming languages )
I tried zxb .exe version 1.2.9-s758 and zxb version 1.2.9-s882
this problem also occurrence with CAST(integer,float)
Regards
It comes down to converting a float to a integer.
INT 3.9 gives 3 in normal basic and compiled
INT -3.9 in normal basic this is -4 but compiled the answer is -3
The correct answer is -4 according to the ZX basic manual (and also according other programming languages )
I tried zxb .exe version 1.2.9-s758 and zxb version 1.2.9-s882
this problem also occurrence with CAST(integer,float)
Regards