148252Sbostic /*-
248252Sbostic * Copyright (c) 1991 The Regents of the University of California.
348252Sbostic * All rights reserved.
448252Sbostic *
548252Sbostic * %sccs.include.proprietary.c%
648252Sbostic */
748252Sbostic
814486Ssam #ifndef lint
9*58335Storek static char sccsid[] = "@(#)sqrt.c 4.5 (Berkeley) 03/01/93";
1048252Sbostic #endif /* not lint */
1111018Sshannon
1211018Sshannon # include "e.h"
1311018Sshannon
eqsqrt(p2)14*58335Storek eqsqrt(p2) int p2; {
1511023Sshannon #ifndef NEQN
1611018Sshannon int nps;
1711023Sshannon
1811018Sshannon nps = EFFPS(((eht[p2]*9)/10+5)/6);
1911023Sshannon #endif NEQN
2011018Sshannon yyval = p2;
2111023Sshannon #ifndef NEQN
2211018Sshannon eht[yyval] = VERT( (nps*6*12)/10 );
2311018Sshannon if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n",
2411018Sshannon yyval, p2, ebase[yyval], eht[yyval]);
2511018Sshannon if (rfont[yyval] == ITAL)
2611018Sshannon printf(".as %d \\|\n", yyval);
2711023Sshannon #endif NEQN
2811018Sshannon nrwid(p2, ps, p2);
2911023Sshannon #ifndef NEQN
3011018Sshannon printf(".ds %d \\v'%du'\\s%d\\v'-.2m'\\(sr\\l'\\n(%du\\(rn'\\v'.2m'\\s%d",
3111018Sshannon yyval, ebase[p2], nps, p2, ps);
3211018Sshannon printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", -ebase[p2], p2, p2);
3311018Sshannon lfont[yyval] = ROM;
3411023Sshannon #else NEQN
3511023Sshannon printf(".ds %d \\v'%du'\\e\\L'%du'\\l'\\n(%du'",
3611023Sshannon p2, ebase[p2], -eht[p2], p2);
3711023Sshannon printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", eht[p2]-ebase[p2], p2, p2);
3811023Sshannon eht[p2] += VERT(1);
3911023Sshannon if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n",
4011023Sshannon p2, p2, ebase[p2], eht[p2]);
4111023Sshannon #endif NEQN
4211018Sshannon }
43