At 14:35 -0500 11/14/07, Andy Dougherty wrote: SNIP >Bottom line: the floating point equality warning is the expression of >a philosophy of math issue, and you may not be following the >philosophy. That's cool. But it's not viable IMHO to not adhere to >the philosophy, but try to keep the warning. > >The philosophy of math issue is that if you are taking floats as >approximations of reals, equality does not usually mean anything >useful. It almost never means what the programmer is trying to >express via equality. Floating point zero (0.00) means zero plus or >minus an error, just as with any other floating point number. Zero >is not special in any sense. Are all your "special case" floating >zeroes safe from being mistaken for certain very small but non-zero >numbers in all implementations? SNIP >Sorry to interrupt your work, but I've followed your list and seen >this come up several times and I hoped this might help, SNIP >thanks for your work,
Many thanks are due and I do appreciate what's going on. What is really needed is a new "float" which might be named "measurement". Measurements contain a value, a unit from the SI list, and an estimate of error. They are a class that would fit easily into the O-O world that exists today. It might well include complex values and vectors. Asking if two measurements are equal would be meaningful because each value, as calculated from other measurements, would come with its own estimate of error. Ditto for an "is it zero" question. But.. . . perl is a practical extraction and report generator - I think. Yes. I use perl 5 to do engineering and it's a decent replacement for FORTRAN. But it's reason de etre is to make text manipulation easy and I use it for that too. I look forward to a perl 6 that provides a way to create a universal module that implements a class measurement with all of the bells and whistles I would like - units and error estimates. I would also like to see real vector operations that do dot and cross products. But it's more important that the text processing and basic - extendable - package be implemented right soon now. I can wait for, and possibly contribute to, engineering additions that will provide what I want. Let's get perl 6 out into the world and add the mathematical niceties later. Just be sure it's possible to do that. -- Applescript syntax is like English spelling: Roughly, though not thoroughly, thought through.