Skip to content

Commit

Permalink
Simple example program computing the Tetranacci constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Raoul Bourquin committed Jun 29, 2023
1 parent 4bfa911 commit 3ed2b4b
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions examples/tetranacci.c
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;
}

0 comments on commit 3ed2b4b

Please sign in to comment.