Jump to content

Ramanujan's constant: Difference between revisions

m
Line 73:
 
=={{header|J}}==
Project: compute, expressed in mathematica then j notation, <pre>Exp[Pi*Sqrt[163]] ^ o. %: 163</pre> .
 
J natively supports Boolean 0 1, integer 00 01 2 3 9, extended integer* 9x, rational 1r2, floating point as c double 0.5, and complex numbers 2ad90 (radius 2, 90 angle in degrees). J does not natively support arbitrary precision decimal, or ternary. J can format a rational numberrationals as an arbitrary precision base 10 literalliterals.
 
Rational arithmetic with series expansion therefor serves to compute Ramanujan's constant. We test for convergence in the base 10 literal expression over the required length. Exponential expansion is unwieldly. We divide by 8x, then raise the series sum to the 8th power. We also convert the rational exponent to a base 10 rational number of sufficient digits to reduce size.
 
*Taking a rational power of an extended integer produces a floating-point result whenever the denominator of the power is not 1.
 
<pre>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.