From: Morton Goldberg Date: 2007-09-03T11:22:41+09:00 Subject: Re: Bug in % (Float)? On Sep 2, 2007, at 7:57 PM, Calamitas wrote: > On 02/09/07, Morton Goldberg wrote: >> On Sep 2, 2007, at 7:32 AM, Calamitas wrote: >> I'm not too surprised. It was bound to break for some sufficiently >> small n; the discontinuities become denser as n -> 0. My horror over >> Ruby's (actually I suspect the underlying C math library) result with >> n = 0.1 is 0.1 is so large. Even 0.00032 is rather a larger n than I >> would like. > > Well, the smallest n for which m_mod_n(1.0, 1.0 / n) is way off is n = > 93. If it's any consolation though, among the first million n, there > are only 78161 for which m_mod_n doesn't give something zeroish. There > are 497886 such n for which Ruby's built-in % is off. That is a real consolation :) Seriously, to me, this is the most convincing argument you've come up with in support of your position that finding a better method for computing % with floats is a lost cause. > Will you let me know what Wolfram Research answers? Certainly. I'll pass it on directly to your gmail account. It may be some time before I get an answer since they are a bit swamped right now with problems arising from their new Mathematica 6 release, and my query is a minor side-issue from their POV. Regards, Morton