X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fising.git;a=blobdiff_plain;f=ising.c;fp=ising.c;h=0b342332c8cf0dde84c4ef50679e791f48753e2a;hp=e1444d891d0b818178c60564007fdac64f60c50e;hb=547d34486c23b434ce7c071702ae4a6f03dcba68;hpb=62002d5d0469045bb0b6f1ff7832ed5029c5267d diff --git a/ising.c b/ising.c index e1444d8..0b34233 100644 --- a/ising.c +++ b/ising.c @@ -153,7 +153,7 @@ int main(int argc, char **argv) if((*(atom+((max_x+x_c-1)%max_x)+y_c*max_x))&1) ++count_p; if(((*(atom+x_c+y_c*max_x))&1)==0) count_p=4-count_p; delta_e=(2*count_p-4)*s; - if(delta_e<0) *(atom+x_c+y_c*max_x)=(*(atom+x_c+y_c*max_x)+1)&1; + if(delta_e<=0) *(atom+x_c+y_c*max_x)=(*(atom+x_c+y_c*max_x)+1)&1; else { if(1.0*rand()/RAND_MAX