Le Mon, 6 Feb 2012 07:45:49 -0800 (PST), rjf <fate...@gmail.com> a écrit : > > On Feb 5, 3:02 am, Julien Puydt <julien.pu...@laposte.net> wrote: > > Le 04/02/2012 23:11, Robert Bradshaw a crit : > > > > ..... > > > I think cos(0.0) != 1.0 isn't bad, since 0.0 isn't zero anyway, and > > 1.0 isn't one anyway. In fact, I would welcome if using strict > > comparisons on floats triggered an exception. > > > > And this monotonicity condition in numerical approximations is new > > to me... do you have a reference handy? I always thought the only > > condition was on relative error. > > > Given your admitted ignorance on the topic of numerical > approximations,
I admit again that I don't know enough details to be confortable with it -- or I wouldn't call for feedback and help here : I would just provide a nice patch! > how much weight should we give to your expressed thought that 0.0 > isn't zero > and 1.0 isn't one? (etc.) Hint: your thoughts are unhelpful. 0.0 is a range of numbers, and zero is in that range, and I think they shouldn't be considered equal. I know most compilers/interpreters in most languages will tell otherwise, but it is a lie, and some languages *do* refuse such comparisons, so the idea isn't unhelpful ; it's a design choice that others made. Even if the ARM eglibc has precision issues, the fact that sage makes float computations then tests with an equality is still wrong (worse, it's converting them to strings then testing that for equality!): that makes those tests portable essentially to x86_64/linux, x86_64/mosx, x86_64/win32... > I suggest you become better informed on the topic. I'm conscious of the difference between an exact computation and a numerical computation, which I think is a pretty good start, even if I admit (again) it isn't perfect. > In order to keep this note from being complete snark, I chose my nickname years ago in reference to "The hunting of the snark", by Lewis Carroll (see [1]); and since I'm not a native english speaker, I wasn't (back then) even aware of the word/meaning you just used. Now I do know it, and I find you choice of words quite petty. > let me suggest > you (and others concerned about these matters look at this) > http://www.cims.nyu.edu/~dbindel/class/cs279/dsb-bib.pdf It is a nice list of references ; if you could have a look at [2], I think you would see that the problem isn't as simple as you think it is. The first two paragraphs will be enough. Still, I'm glad you think the problem is trivial/doesn't exist : that means you'll be able to provide a nice patch real soon. Looking forward for your fix, thanks for your suggestions, Snark on #sagemath [1] http://en.wikipedia.org/wiki/The_Hunting_of_the_Snark [2] http://www.network-theory.co.uk/docs/gccintro/gccintro_70.html -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org