back to table · edit · history · where entries came from · files · download
1032 bytes, as of the version from 2026-11-18 14:47 (current). Recorded here, not run.
/* Adapter for unmodified FLINT secondary_zeta.c (LGPL 3 or later).
Build with a compatible FLINT library and its public headers. */
#include <stdio.h>
#include <string.h>
#include "flint.h"
#include "acb.h"
#include "secondary_zeta.h"
char *numberdb_secondary_eval(long order, long prec, long digits)
{
acb_t s, value;
acb_init(s); acb_init(value); acb_set_si(s, order);
acb_dirichlet_secondary_zeta(value, s, prec);
char *out;
if (!acb_is_finite(value) || !arb_contains_zero(acb_imagref(value)))
{
out = flint_malloc(64); snprintf(out, 64, "invalid");
}
else
{
char *v = arb_get_str(acb_realref(value), digits, ARB_STR_MORE);
out = flint_malloc(strlen(v) + 100);
snprintf(out, strlen(v) + 100, "%ld\n%s", arb_rel_accuracy_bits(acb_realref(value)), v);
flint_free(v);
}
acb_clear(s); acb_clear(value); return out;
}
void numberdb_secondary_free(void *ptr) { flint_free(ptr); }
const char *numberdb_flint_version(void) { return flint_version; }