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)
Smallest Number ZX80
Smallest Number ZX80
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: Smallest Number ZX80
Hi Paul
Will try this on My 80 and get back to You.
moggy
Will try this on My 80 and get back to You.
moggy
Re: Smallest Number ZX80
This is simply to assymmetric values for plus and minus because of the zero which cuts "one".Paul wrote: 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)
In general for signed integers 8 bit is defined = positive range 0 to 127, negative range -1 to -128. For 16 bit 0 to 32767 and -1 to -32768.
I think this is caused by simplifying conversion in ZX80 rom.
I think they simply interprete the value and do a NEG (2's complement) when detecting a minus in front.
But not checked the code for it.
Re: Smallest Number ZX80
@ Paul same result on real ZX80.
Regards
Moggy
Regards
Moggy