xref: /csrg-svn/old/eqn/common_source/sqrt.c (revision 11018)
1*11018Sshannon /*	sqrt.c	4.1	83/02/11	*/
2*11018Sshannon 
3*11018Sshannon # include "e.h"
4*11018Sshannon 
5*11018Sshannon sqrt(p2) int p2; {
6*11018Sshannon 	int nps;
7*11018Sshannon 	nps = EFFPS(((eht[p2]*9)/10+5)/6);
8*11018Sshannon 	yyval = p2;
9*11018Sshannon 	eht[yyval] = VERT( (nps*6*12)/10 );
10*11018Sshannon 	if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n",
11*11018Sshannon 		yyval, p2, ebase[yyval], eht[yyval]);
12*11018Sshannon 	if (rfont[yyval] == ITAL)
13*11018Sshannon 		printf(".as %d \\|\n", yyval);
14*11018Sshannon 	nrwid(p2, ps, p2);
15*11018Sshannon 	printf(".ds %d \\v'%du'\\s%d\\v'-.2m'\\(sr\\l'\\n(%du\\(rn'\\v'.2m'\\s%d",
16*11018Sshannon 		yyval, ebase[p2], nps, p2, ps);
17*11018Sshannon 	printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", -ebase[p2], p2, p2);
18*11018Sshannon 	lfont[yyval] = ROM;
19*11018Sshannon }
20