[erlang-questions] how: best way to deal with floats in eunit?

Richard Carlsson <>
Tue Aug 12 21:49:35 CEST 2008


Gustavo Niemeyer wrote:
> What do you mean by the "floating point-people"?  Are you looking for the
> IEEE 754 implementers?

No, just people who know what they want from their floating point
operations. In my experience, doing floating-point computations right
is always trickier that one would think, and the people who can tell you
precisely how and why belong to a rather select priesthood.

> I do deal with testing of floating point values very frequently, and you've
> asked for "some input as regards how such an assertion should work",
> which was exactly what was provided hoping it'd be useful as a data
> point.  I won't bother next time.

Well, I _do_ appreciate input, but if you see it from my perspective,
you didn't actually tell me that you _did_ have any real experience with
floating point computations - you just pointed me at a single example
from another framework, which might or might not have been implemented
by someone with even less experience than me.

I'm just a bit surprised that most frameworks seem to provide only an
absolute error assertion, since I thought the relative error was often
a better measure. I suppose I should provide macros for both variants.

     /Richard



More information about the erlang-questions mailing list