Repository navigation
CPCSyntaxError v0.14.3
CPCSyntaxError v0.14.3
BASIC window: real numbers are correct
- "From the machine" now shows real numbers as BASIC 1.1's own LIST shows them.
- Before, a line such as
FOR a=0 TO 6.4 STEP 0.3came into the editor asFOR a=0 TO 6.400000000372529 STEP 0.30000000004656613. - Cause: BASIC keeps a real number in 5 bytes (about 9 digits). The window printed it with all the digits of a PC number.
- Now the window writes the shortest number that gives the same 5 bytes back. The format is the BASIC LIST format:
6.4,0.3,0.00001,1.23456789E+09,1E+10,2.5E-20. - When a number needs a 10th digit, the window keeps it, so "To the machine" puts back the same bytes.
- Tested on the 464, 664 and 6128 BASIC ROMs.
Thanks to the user who reported this problem.