blob: 3424a9951aa40c1572ad3a1b7ce3e130087507b8 (
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
27
28
29
30
31
32
|
#include <stdio.h>
#include "real.h"
#include <math.h>
/*
* Tests the exp_QInt when applied to an int rational.
*/
main(int argc, char *argv[])
{
Real x, y;
int a, b;
double f;
Real makeRealSignCNQInt(Sign, char *, int, int, int);
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 = exp_QInt(a, b);
print_R_Dec(x, atoi(argv[3]));
printf("\n");
printf("exp(x)=%f\n", exp(f));
}
|