aboutsummaryrefslogtreecommitdiff
path: root/ic-reals-6.3/tests/t3.c
blob: 9d5dd2671c44685e85da7b2c974b09ceba733798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <stdio.h>
#include "real.h"
#include <math.h>

main(int argc, char *argv[])
{
	Real x, y, z;
	int a, b;
	double f;

	MyName = argv[0];

	if (argc != 4) {
		fprintf(stderr, "%s <a> <b> <ndigits>\n", MyName);
		exit(1);
	}

	initReals();

	a = atoi(argv[1]);
	b = atoi(argv[2]);
	x = real_QInt(a, b);
	y = mul_R_R(x, x);
	print_R_Dec(y, atoi(argv[3]));
	printf("\n");
}