Gerhard Niklasch on Tue, 9 May 2000 09:38:19 +0200 (MET DST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Bug in default |
In response to: > Message-ID: <20000509025722.A17225@monk.mps.ohio-state.edu> > Date: Tue, 9 May 2000 02:57:22 -0400 > From: Ilya Zakharevich <ilya@math.ohio-state.edu> > To: Jack Fearnley <jack@alcor.concordia.ca> > Cc: pari-dev@list.cr.yp.to > References: <3.0.1.32.20000508222452.00688eac@alcor.concordia.ca> > > On Mon, May 08, 2000 at 10:24:52PM -0400, Jack Fearnley wrote: > > ? default(format,"g0.7") > > format = g0.7 > > ? default(realprecision) > > realprecision = 28 significant digits (7 digits displayed) > > ? default(realprecision,,1) > > %2 = 7 > > ? > > ********************************************************************* > > While computation is proceeding with the correct realprecision (28 in this > > case) the function call > > default(realprecision,,1) is returning 7 which is the displayed number of > > digits. This is a feature. In fact, the opposite question was asked recently. Cf. postings D-000900, D-000901 from the turn March/April. precision(x) is what you're looking for. Note that in certain circumstances, the precision of a result may be larger or smaller than the default realprecision's underlying number of digits -- compare precision(1.) to precision (1+0.) . Use the former to recover the default value. Use precision(x) to find out to what precision x has in fact been computed. > This is related to another problem: when you request calculations with > 7 digits, they are done with 9 (as they should), but the info that you > in fact requested 7 is not stored anywhere. Of course it is stored somewhere -- this is just what Jack has been pointing out! :) Enjoy, Gerhard