On 11/14/06, Rhythmic Fistman <[EMAIL PROTECTED]> wrote: > On 11/14/06, skaller <[EMAIL PROTECTED]> wrote: > > > > I'm with 3. floats are just tricky. > > > > Clearly distrib and many other related axioms don't hold, > > but simply giving up isn't an option either. > > Ok, recognising that the axioms won't compose more than > a few times "close" works fine. I used a similar thing > for a mathlib I wrote a while back, occasionally adjusting > the definition of close for various operations and sometimes > even for different machines (ppc->386 lost some precision > for some calculations). > > > > val result, error = witherror (x * (y * z)); > > > > I think you would use a record: > > > > struct { > > approx: float; > > lobound: float; > > hibound: float; > > ... > > } > > > > and just define + - * / etc etc on it using a typeclass, > > then you could write algorithms which work for real numbers, > > including this version of them .. I guess this is monadic > > programming .. Felix does have typeclasses now :) > > That would work? Cool bananas. That reminds me, I have a > type class question... >
Here's something pretty neat/cute, thanks to Jimmy, for testing when there aren't any further floats available thanks to ieee float lexographical ordering. http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language