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
- Follow-Ups:
- Re: Arbitrary-precision numbers in patterns
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Arbitrary-precision numbers in patterns