瀏覽代碼

Fix computing difference

Samuel Thibault 6 年之前
父節點
當前提交
3b301b5328
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/heat/heat.c

+ 1 - 1
examples/heat/heat.c

@@ -331,7 +331,7 @@ static float compute_A_value(unsigned i, unsigned j, point *pmesh)
 	theta_j = NODE_TO_THETA(j);
 
 	/* Compute the Sum of all the integral over all triangles */
-	if ( (abs(thick_i - thick_j) <= 1) && (abs(theta_i - theta_j) <= 1) )
+	if ( (abs((int)thick_i - (int)thick_j) <= 1) && (abs((int)theta_i - (int)theta_j) <= 1) )
 	{
 		if ( (theta_j == theta_i -1) && (thick_j == thick_i +1))
 			goto done;