Page 1 of 1

IDE Debugger doesn't interpret quads correctly

Posted: Sun Nov 16, 2008 4:12 pm
by AND51
Hello!

I just discovered this odd bug in PB 4.30 x86 BETA 4.

Doesn't work:

Code: Select all

For n=60 To 20 Step -10
	Debug 1<<n
Next
Debugger wrote:268435456
262144
256
1073741824
1048576
Works:

Code: Select all

For n=60 To 20 Step -10
	quad.q=1<<n
	Debug quad
Next
Debugger wrote:1152921504606846976
1125899906842624
1099511627776
1073741824
1048576

Posted: Sun Nov 16, 2008 4:16 pm
by Trond
n is not a quad, and it doesn't become any bigger by shifting its bits.

Posted: Sun Nov 16, 2008 4:28 pm
by AND51
Sure n is not a quad. But that#s not the point.
The point is that the result is a quad. (At least the first 2 or 3 results are quad-like).
You wrote:by shifting its bits
Not n is being shifted; '1' is being shifted! IMHO you misunderstand the expression in this case.
Correct me, if I'm wrong.

Reason found!

Posted: Sun Nov 16, 2008 4:29 pm
by AND51
@ freak:
Now I know the reason:
In the 64 Bit version of PB 4.30 BETA 4 it works!!

I think it has to do with the new default data type '.i', which turns all variables under 32 Bit to a Long by default. Am I right?