Re: Numerical instability in extracting base B digits of the fractional part of real
Bill Allombert <[email protected]> Fri, 16 Feb 2024 17:09:01 +0100
| Newsgroups | gmane.comp.mathematics.pari.devel |
|---|---|
| Message-ID | <Zc+InbDj44/YHxrK@seventeen> |
On Fri, Feb 16, 2024 at 05:55:54PM +0200, Georgi Guninski wrote: > On Fri, Feb 16, 2024 at 1:20 PM Bill Allombert > <[email protected]> wrote: > > > > ? a=.33 > > %6 = 0.33000000000000000000000000000000000000 > > ? a*10-3 > > %7 = 0.30000000000000000000000000000000000000 > > ? b=a*10-3 > > %8 = 0.30000000000000000000000000000000000000 > > ? b*10-3 > > %9 = -2.350988701644575016E-38 > > > > Thanks. Why I don't see -2.350988701644575016E-38 in my session? > It must be there, since you unrolled the first two iterations of > the loop. Because you continue with A=frac(A), and since A is negative, it is A+1, so ? frac(b*10-3) %5 = 0.99999999999999999999999999999999999998 Cheers, Bill.