The main culprit in all of this discussion is the floating-point real number format. Equal looks at the last seven binary digits instead of the last one. Equal fares a little bit better than SameQ - but emphasis on "little". Now, back to the problem of floating point equality. That last is particularly baffling, since the same number appears twice in the list with different counts. While preparing an answer to Count how many different values a list takes in Mathematica I came across an instability (for lack of a better term) in both DeleteDuplicates and Tally that I do not understand.Ĭonsider first: a =
0 Comments
Leave a Reply. |