Smallest Number ZX80
Posted: Mon Nov 28, 2011 11:14 am
Hi,
I used the search of this forum and couldn't any ZX80 related entries about this. This is not a question, I just wanted to share what I saw.
In theory a 16 bit integer normally has a range from -32768 to 32767. I wanted to test if this is the same on a ZX80. So I tried to enter
10 LET A=-32768 which I cannot as the number is seen to be invalid (Syntaxerrorcursor)
10 LET A=-32767 works fine. Even if you want to enter the smallest possible number in a INPUT statement you cannot. But you can calculate this
Just use -32767-1
10 LET A=-32767-1 works.
Funny that Sinclair Basic does a test on the size of the number during entry, but doesn't recognize negative numbers
(Used EO to test, not real machine. No difference expected)
I used the search of this forum and couldn't any ZX80 related entries about this. This is not a question, I just wanted to share what I saw.
In theory a 16 bit integer normally has a range from -32768 to 32767. I wanted to test if this is the same on a ZX80. So I tried to enter
10 LET A=-32768 which I cannot as the number is seen to be invalid (Syntaxerrorcursor)
10 LET A=-32767 works fine. Even if you want to enter the smallest possible number in a INPUT statement you cannot. But you can calculate this
Just use -32767-1
10 LET A=-32767-1 works.
Funny that Sinclair Basic does a test on the size of the number during entry, but doesn't recognize negative numbers
(Used EO to test, not real machine. No difference expected)