shithub: mc

Download patch

ref: 9c8878e3976780b0c04bd2a737edd09dd47816c7
parent: 6774b615c4397e76e6f60ce2179ce8b4fad57aa0
author: Ori Bernstein <[email protected]>
date: Mon Dec 30 08:34:01 EST 2013

Fix typo in sqrt() test.

--- a/test/sqrt.myr
+++ b/test/sqrt.myr
@@ -18,12 +18,13 @@
 
 	val = 1.0;
 	for i = 0; i < Maxiter; i++
-		iter = 0.5*(val - x/val)
+		iter = 0.5*(val + x/val)
 		if abs(val - iter) < Eps
 			-> val;
-			val = iter;
 		;;
+		val = iter;
 	;;
+	-> val
 }
 
 const main = {