Re: computing Bernoulli numbers



Bart Vandewoestyne wrote:
On 2008-01-31, Michel Olagnon <molagnon@xxxxxxxxxxxxxxxxx> wrote:


Looking at the numbers I get and how they differ from what I
must expect, it looks like i'm switching from double precision
to single precision somewhere, but I do not see where that
happens in my code :-(


OK, found it:

do
term = 1.0_qp/(i**n)
****
term = (1.0_qp/i)**n

otherwise i**n overflows, and gives a negative value.

.



Relevant Pages

  • Re: floating point precision
    ... instead of switching to single precision. ... > i have recently discovered that d3d silently switches the floating point ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Floating Point Precision
    ... >I have a question about floating point precision in C. ... >numbers that differ by less than this epsilon? ... on different computers -- too many to list them all in one message. ... the native double precision size is 80 bits ...
    (comp.lang.c)
  • Re: distance between points on the earth
    ... precision for degrees to radians and radius of the earth (by the way, ... I have seen values that differ by about 4 miles) ... Are the generic sin,cos and acos functions sufficient? ... digits of precision and you want more than 17 decimal digits, ...
    (comp.lang.fortran)
  • Re: writing sequences to a file
    ... Bart Vandewoestyne wrote: ... The sequences have N such points. ... "as much precision as possible" usually means UNFORMATTED. ... point means I can control every last bit. ...
    (comp.lang.fortran)
  • Re: nearest and tiny
    ... Bart Vandewoestyne wrote: ... This has nothing to do with your question, but it's risky to ... use 2*precision(1.0_sp) as a way to get "double" precision. ... The standard doesn't require double to have twice ...
    (comp.lang.fortran)