From: simon Date: Sat, 5 Jul 2008 22:07:35 +0000 (+0000) Subject: Correction from James H: sqrt(0) shouldn't occur any more than X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/commitdiff_plain/8e402806b508e8f8a922b280a9c55014babe1bff Correction from James H: sqrt(0) shouldn't occur any more than sqrt(1) should. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@8108 cda61777-01e9-0310-a592-d414129be87e --- 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); }