home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
247_02
/
roots.c
< prev
next >
Wrap
Text File
|
1989-04-19
|
640b
|
28 lines
/*
* Program to calculate roots
*/
#include <stdio.h>
#include "miracl.h"
main()
{ /* Find roots */
flash x,y;
int n;
mirsys(-45,MAXBASE);
x=mirvar(0);
y=mirvar(0);
POINT=ON;
printf("enter number\n");
cinnum(x,stdin);
printf("to the power of 1/");
scanf("%d",&n);
getchar();
froot(x,n,y);
cotnum(y,stdout);
fpower(y,n,x);
printf("to the power of %d = ",n);
cotnum(x,stdout);
if (EXACT) printf("Result is exact!\n");
}