rogerl
Reputation
1,381
Next privilege 2,000 Rep.
Edit questions and answers
 Mar 20 awarded Yearling Feb 9 awarded Popular Question Jan 17 awarded Nice Answer Jan 3 comment Identify the independent variable in an expression @Jens So you would advocate the approach in your answer to my question over the answers here in terms of generality? Jan 3 comment Identify the independent variable in an expression @Jens So I've been trying to figure out exactly why all the answers here are so different from the great answer you gave me to the question you referenced in your comment above. Dec 26 accepted Compilation, square roots, and integers Dec 26 comment Compilation, square roots, and integers Thanks for the very detailed analysis. It clears things up for me quite a bit. One small comment: you say $MachineEpsilon == 2^-53; in fact it appears to be 2^-52. Dec 25 comment Compilation, square roots, and integers You are right about IntegerQ; I was just confused. But why should I start to see errors at$10^{14}$, which is over$45$times smaller (over five bits) less than$2^{52}$? Again, my goal here is just to determine the range in which I can use this kind of integer function. Dec 25 comment Compilation, square roots, and integers But the problem is not with Sqrt, it's with ==: if you define isSq := IntegerQ@Sqrt@# &, that works properly with$2^{52}+1$(that is, it returns False). Also,$2^{52}\approx 4\times 10^{15}$, which is much bigger than where I started to see failures of isSq2. So is there documentation anywhere of what tolerances == uses? (I don't really care what those tolerances are, but it would be nice to know in what range you could count on "exactness"). Dec 25 comment Fastest square number test @KennyColnago You might want to look at this question that I posted this morning. I've done some more investigation of this issue. Dec 25 revised Compilation, square roots, and integers added 534 characters in body Dec 25 comment Compilation, square roots, and integers @JohnMcGee But doesn't isSq2 work with integers rather than reals? Dec 25 asked Compilation, square roots, and integers Dec 25 comment Selection bugs make Mathematica 10 unusable No ideas, sorry. All seems pretty odd. Dec 25 comment Selection bugs make Mathematica 10 unusable I just noticed the length of time between your deleting the cache info and the bug reappearing. Certainly suggests crap building up somewhere. I'll keep this in mind. Dec 25 comment Selection bugs make Mathematica 10 unusable I see exactly what I expect; the cursor ends up between two appropriate characters, and nothing is selected. Dec 25 comment Selection bugs make Mathematica 10 unusable Well, up to you, obviously, but a) if you still have it on your machine it's easy to try, and b) if the bug does go away you have something definitive you can go back to Wolfram with. Dec 25 comment Selection bugs make Mathematica 10 unusable Have you tried dropping back to 9 to make sure the bug goes away? Dec 25 comment Can we compile using only Integers Of Unusual Size? Oh, and with respect to the minimum machine-size integer, I think you would expect it to be equal to -$MaxMachineInteger + 1, not -$MaxMachineInteger-1$. But in any case, -$MaxMachineInteger returning True is indeed unexpected. Dec 25 comment Can we compile using only Integers Of Unusual Size? Thanks. I didn't know about that package. And so given this (on my machine, this is$2^{63}-1\$, as I expected), can I expect compiled programs with integer arguments to function properly up to this bound? (I realize that this is exactly what the documentation for Compile says.)