IDE Debugger doesn't interpret quads correctly

Working on new editor enhancements?
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

IDE Debugger doesn't interpret quads correctly

Post 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
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

n is not a quad, and it doesn't become any bigger by shifting its bits.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post 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.
PB 4.30

Code: Select all

onErrorGoto(?Fred)
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Reason found!

Post 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?
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Post Reply