-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple example program computing the Tetranacci constant
- Loading branch information
Raoul Bourquin
committed
Jun 29, 2023
1 parent
4bfa911
commit 3ed2b4b
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* This file is public domain. Author: Raoul Bourquin. */ | ||
|
||
#include <stdlib.h> | ||
#include "ca.h" | ||
|
||
|
||
void main_fexpr() | ||
{ | ||
fexpr_t T; | ||
fexpr_init(T); | ||
|
||
flint_printf("Evaluating Tt as fexpr:\n"); | ||
|
||
fexpr_set_symbol_str(T, "TetranacciConstant"); | ||
|
||
fexpr_print(T); | ||
printf("\n\n"); | ||
|
||
fexpr_clear(T); | ||
} | ||
|
||
|
||
void main_ca() | ||
{ | ||
ca_ctx_t ctx; | ||
ca_t T; | ||
ca_ctx_init(ctx); | ||
ca_init(T, ctx); | ||
|
||
flint_printf("Evaluating Tt as ca:\n"); | ||
|
||
ca_tetranacci_constant(T, ctx); | ||
|
||
ca_print(T, ctx); | ||
printf("\n\n"); | ||
|
||
ca_clear(T, ctx); | ||
} | ||
|
||
|
||
void main_qqbar() | ||
{ | ||
qqbar_t T; | ||
qqbar_init(T); | ||
|
||
flint_printf("Evaluating Tt as qqbar:\n"); | ||
|
||
qqbar_tetranacci_constant(T); | ||
|
||
qqbar_printn(T, 50); | ||
printf("\n"); | ||
|
||
qqbar_clear(T); | ||
} | ||
|
||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
main_fexpr(); | ||
main_ca(); | ||
main_qqbar(); | ||
|
||
flint_cleanup(); | ||
return EXIT_SUCCESS; | ||
} |