Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

More problems with SetPrecision[] and/or $MinPrecision,...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56954] More problems with SetPrecision[] and/or $MinPrecision,...
  • From: terryisnow at yahoo.com
  • Date: Wed, 11 May 2005 05:24:09 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Mathematica Guru's,

Lately I seem to be finding a lot of SetPrecision[]/$MinPrecision bugs.
This appears to be another one:

In[1]:= $MinPrecision = 20;

        savedData1 = 669151541.9328941107875;
        savedData2 = 0.99960472897267246018765;
        savedData3 = Log[savedData1^savedData2/savedData1^savedData2];

        Print[Apply[Plus, savedData3 -
Log[savedData1^savedData2/savedData1^savedData2]] ];

        x = 0.99960472897267245645;
        y = 669151541.932894110712;
        Do[
           z = SetPrecision[y,24]^x;
        ,{50000}];

        Print[Apply[Plus, savedData3 -
Log[savedData1^savedData2/savedData1^savedData2]] ];

The output looks like this on my Mathematica 3.0 system:

        0
        1.9586707534418188626 x 10^-30

Obviously the question is why is the second Print statement not
also returning a 0, after all the code that runs between the two
Print statements neither changes any of the variables referenced
by the two Print statements, nor even references any of the same
variables.

The problem maybe reproducible without the $MinPrecision but with
this specific test case it is needed (there might however be other
constants that can reproduce the problem without $MinPrecision).

Can someone also run this on a more recent version of Mathematica
to see if it reproduces? All help is very much appreciated!

Terry


  • Prev by Date: Re: Partitioning a list from an index
  • Next by Date: Re: Re: Folding Deltas
  • Previous by thread: Re: ChineseRemainder
  • Next by thread: Re: More problems with SetPrecision[] and/or $MinPrecision,...