aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2008-07-05 22:07:35 +0000
committerSimon Tatham <anakin@pobox.com>2008-07-05 22:07:35 +0000
commitc6b1d4472b2f339c54c9c9de06c6ebef2a92dba9 (patch)
tree0fa37ab192094669a50c73348c8a3e054d51151a
parent4322b90cbb73fb7bd5eb62378115323043d95ada (diff)
downloadpuzzles-c6b1d4472b2f339c54c9c9de06c6ebef2a92dba9.zip
puzzles-c6b1d4472b2f339c54c9c9de06c6ebef2a92dba9.tar.gz
puzzles-c6b1d4472b2f339c54c9c9de06c6ebef2a92dba9.tar.bz2
puzzles-c6b1d4472b2f339c54c9c9de06c6ebef2a92dba9.tar.xz
Correction from James H: sqrt(0) shouldn't occur any more than
sqrt(1) should. [originally from svn r8108]
-rw-r--r--unfinished/numgame.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unfinished/numgame.c b/unfinished/numgame.c
index 8f59c73..20861ca 100644
--- a/unfinished/numgame.c
+++ b/unfinished/numgame.c
@@ -542,9 +542,9 @@ static int perform_sqrt(int *a, int *b, int *output)
int half[2] = { 1, 2 };
/*
- * sqrt(1) == 1: don't perform unary noops.
+ * sqrt(0) == 0, sqrt(1) == 1: don't perform unary noops.
*/
- if (a[0] == 1 && a[1] == 1) return FALSE;
+ if (a[0] == 0 || (a[0] == 1 && a[1] == 1)) return FALSE;
return perform_exp(a, half, output);
}