BSD 4_2 release
[unix-history] / usr / src / usr.bin / eqn / sqrt.c
index 2229328..65a63b7 100644 (file)
@@ -1,17 +1,35 @@
+#ifndef lint
+static char sccsid[] = "@(#)sqrt.c     4.3 8/11/83";
+#endif
+
 # include "e.h"
 
 sqrt(p2) int p2; {
 # include "e.h"
 
 sqrt(p2) int p2; {
+#ifndef NEQN
        int nps;
        int nps;
+
        nps = EFFPS(((eht[p2]*9)/10+5)/6);
        nps = EFFPS(((eht[p2]*9)/10+5)/6);
+#endif NEQN
        yyval = p2;
        yyval = p2;
+#ifndef NEQN
        eht[yyval] = VERT( (nps*6*12)/10 );
        if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", 
                yyval, p2, ebase[yyval], eht[yyval]);
        if (rfont[yyval] == ITAL)
                printf(".as %d \\|\n", yyval);
        eht[yyval] = VERT( (nps*6*12)/10 );
        if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", 
                yyval, p2, ebase[yyval], eht[yyval]);
        if (rfont[yyval] == ITAL)
                printf(".as %d \\|\n", yyval);
+#endif NEQN
        nrwid(p2, ps, p2);
        nrwid(p2, ps, p2);
+#ifndef NEQN
        printf(".ds %d \\v'%du'\\s%d\\v'-.2m'\\(sr\\l'\\n(%du\\(rn'\\v'.2m'\\s%d", 
                yyval, ebase[p2], nps, p2, ps);
        printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", -ebase[p2], p2, p2);
        lfont[yyval] = ROM;
        printf(".ds %d \\v'%du'\\s%d\\v'-.2m'\\(sr\\l'\\n(%du\\(rn'\\v'.2m'\\s%d", 
                yyval, ebase[p2], nps, p2, ps);
        printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", -ebase[p2], p2, p2);
        lfont[yyval] = ROM;
+#else NEQN
+       printf(".ds %d \\v'%du'\\e\\L'%du'\\l'\\n(%du'",
+               p2, ebase[p2], -eht[p2], p2);
+       printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", eht[p2]-ebase[p2], p2, p2);
+       eht[p2] += VERT(1);
+       if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", 
+               p2, p2, ebase[p2], eht[p2]);
+#endif NEQN
 }
 }