Bjorn
Thanks for the labs feedback.
I tried the below on both Linux64 and Win64 and it worked fine. Could you
try again, and if there is still a problem, please examine the error line
and try to determine what causes the domain error. Thanks.
Chris
── ((4) 11 of 23) Bernoulli numbers ─────────────────────────
In BON, the coefficients given in the equations defining the
Bernoulli numbers are the alternating binomials, and are used
as shown below. The function x: (used in coeffs) invokes the
use of extended precision, presenting rationals in the form
1r2 and 1r6, etc.:
)
bern=:(] mp numerator % denominator) , ]
numerator=:2 with trim on coeffs
denominator=:2 with from on - on coeffs
coeffs=:abct on inc on x: on #
|domain error: on
| coeffs=: abct on inc on x:on#
|[-3]
abct=:(] BC ei) * (_1 with power on ei)
on=:@:
(this works ok in 32 bit win32 j801)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm