Bill Allombert on Sun, 21 Jan 2024 14:31:42 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: oeis_digits( x, {D=105} )


On Sun, Jan 21, 2024 at 01:54:18PM +0100, Ruud H.G. van Tol wrote:
> Also be aware that the used printf-format rounds to the nearest, so without
> proper care the final digits are easily off.

You can increase your luck with this one:

digreal(f,N)=localprec(N+20);digits(floor(f()*10^N));

? digreal(()->log(2),99)
%26 = [6,9,3,1,4,7,1,8,0,5,5,9,9,4,5,3,0,9,4,1,7,2,3,2,1,2,1,4,5,8,1,7,6,5,6,8,0,7,5,5,0,0,1,3,4,3,6,0,2,5,5,2,5,4,1,2,0,6,8,0,0,0,9,4,9,3,3,9,3,6,2,1,9,6,9,6,9,4,7,1,5,6,0,5,8,6,3,3,2,6,9,9,6,4,1,8,6,8,7]

Cheers,
Bill.