Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Arbitrary-precision numbers in patterns

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45388] Arbitrary-precision numbers in patterns
  • From: Maxim <dontsendhere@.>
  • Date: Mon, 5 Jan 2004 03:51:02 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Compare

In[1]:=
Do[ f[k] = k, {k, 1., 17.} ]
f[1.`20]
Clear[f]

Out[2]=
1.

and

In[1]:=
Do[ f[k] = k, {k, 1., 18.} ]
f[1.`20]
Clear[f]

Out[2]=
f[1.0000000000000000000]

-- and the user's best bet to figure out how it'll work is probably to
flip a coin.

The reason is probably just that the hashing mechanism breaks down,
because the result returned by Mathematica changes after it re-sorts
some internal table of DownValues for f (the 'boundary value' 17 is for
version 5.0 on my machine; if 17. and 18. don't work, try 2. and 100.).
But in general, my opinion is that it is only to be expected -- when we
don't even know for sure how the definitions for f can be reordered.

Maxim Rytin
m.r at prontomail.com



  • Prev by Date: Re: Mathematica exports curves in pieces to Illustrator
  • Next by Date: Re: Show command.
  • Previous by thread: Re: Extracting Matrix
  • Next by thread: Re: Arbitrary-precision numbers in patterns