Calculate Ramanujan's constant (as described on the OEIS site) with at least
32 digits of precision, by the method of your choice. Optionally, if using the 𝑒**(π*√x) approach,
show that when evaluated with the last four Heegner numbers
the result is almost an integer.

without javascript_semantics -- no mpfr_exp() under p2js (yet), sorry
requires("1.0.0") -- (mpfr_set_default_prec[ision] has been renamed)
include mpfr.e
mpfr_set_default_precision(-120) -- (18 before, 100 after, plus 2 for kicks.)
 
function q(integer d)
    mpfr pi = mpfr_init()
    mpfr_const_pi(pi)
    mpfr t = mpfr_init(d)
    mpfr_sqrt(t,t)
    mpfr_mul(t,pi,t)
    mpfr_exp(t,t)
    return t
end function
 
printf(1,"Ramanujan's constant to 100 decimal places is:\n")
printf(1,"%s\n", mpfr_get_fixed(q(163),100))
sequence heegners = {{19, 96},
                     {43, 960},
                     {67, 5280},
                     {163, 640320},
                    }
printf(1,"\nHeegner numbers yielding 'almost' integers:\n")
mpfr t = mpfr_init(), qh
mpz c = mpz_init()
for i=1 to length(heegners) do
    integer {h0,h1} = heegners[i]
    qh = q(h0)
    mpz_ui_pow_ui(c,h1,3)
    mpz_add_ui(c,c,744)
    mpfr_set_z(t,c)
    mpfr_sub(t,t,qh)
    string qhs = mpfr_get_fixed(qh,32),
           cs = mpz_get_str(c),
           ts = mpfr_get_fixed(t,32)
    printf(1,"%3d: %51s ~= %18s (diff: %s)\n", {h0, qhs, cs, ts})
end for
