Skip to content

Commit c1c997f

Browse files
author
Raoul Bourquin
committed
Simple example program computing the Tetranacci constant
1 parent ea14cc0 commit c1c997f

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

examples/tetranacci.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/* This file is public domain. Author: Raoul Bourquin. */
2+
3+
#include <stdlib.h>
4+
#include "ca.h"
5+
6+
7+
void main_fexpr()
8+
{
9+
fexpr_t T;
10+
fexpr_init(T);
11+
12+
flint_printf("Evaluating Tt as fexpr:\n");
13+
14+
fexpr_set_symbol_str(T, "TetranacciConstant");
15+
16+
fexpr_print(T);
17+
printf("\n\n");
18+
19+
fexpr_clear(T);
20+
}
21+
22+
23+
void main_ca()
24+
{
25+
ca_ctx_t ctx;
26+
ca_t T;
27+
ca_ctx_init(ctx);
28+
ca_init(T, ctx);
29+
30+
flint_printf("Evaluating Tt as ca:\n");
31+
32+
ca_tetranacci_constant(T, ctx);
33+
34+
ca_print(T, ctx);
35+
printf("\n\n");
36+
37+
ca_clear(T, ctx);
38+
}
39+
40+
41+
void main_qqbar()
42+
{
43+
qqbar_t T;
44+
qqbar_init(T);
45+
46+
flint_printf("Evaluating Tt as qqbar:\n");
47+
48+
qqbar_tetranacci_constant(T);
49+
50+
qqbar_printn(T, 50);
51+
printf("\n");
52+
53+
qqbar_clear(T);
54+
}
55+
56+
57+
int main(int argc, char *argv[])
58+
{
59+
main_fexpr();
60+
main_ca();
61+
main_qqbar();
62+
63+
flint_cleanup();
64+
return EXIT_SUCCESS;
65+
}

0 commit comments

Comments
 (0)