Computer Chess Club Archives


Search

Terms

Messages

Subject: printing different values for 2 identical numbers

Author: Uri Blass

Date: 05:45:22 09/10/03


I found that my program printed the numbers 0 and 1 when it did the following
code without printing mistake or mistake1.

zobpawnkey[hply]=zobpawn;
if (nodes==663719)
{
	if (zobpawnkey[hply]!=zobpawn)
		printf("mistake");
	if ((zobpawnkey[hply]&1)!=(zobpawn&1))
		printf("mistake1");
	printf(" %d %d              ",(zobpawn&1),(zobpawnkey[hply]&1));
}

both zobpawn and zobpawnkey[hply] are __int 64 varaibles.

How is it possible?
I guess that I cannot trust & of 64 bit varaible with number unless I do some
casting like (int)(zobpawn&1) but I thought that at least I can
expect program to give the same value when it calculate the same thing even if
the calculation is wrong.

Uri



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.