Re: Arbitrary-precision numbers in patterns

*To*: mathgroup at smc.vnet.net*Subject*: [mg45415] Re: [mg45388] Arbitrary-precision numbers in patterns*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Wed, 7 Jan 2004 01:09:05 -0500 (EST)*References*: <200401050851.DAA20153@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

It seems to me that the likely reason for this behaviour is that Mathematica switches to a different "hash function", once the list of hash values starts getting a bit longish. At least to my limited understanding of such things (based only on some knowledge of Knuth, not on practical experience) that would seem to be a natural thing to do. That would of course involve "reordering". However, I doubt that you can expect such things to be made public as long as the source code of Mathematica is not. Andrzej Kozlowski On 5 Jan 2004, at 17:51, Maxim wrote: > 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 > > >

**References**:**Arbitrary-precision numbers in patterns***From:*Maxim <dontsendhere@.>