Boost logo

Boost :

Subject: Re: [boost] [review][constrained_value] Review of Constrained ValueLibrary begins today
From: Stjepan Rajko (stjepan.rajko_at_[hidden])
Date: 2008-12-06 10:44:38


On Sat, Dec 6, 2008 at 6:30 AM, Robert Kawulak <robert.kawulak_at_[hidden]> wrote:
>> From: Gordon Woodhull
>
>> My view is that you just can't actually use any of
>> the built-
>> in operators, but the same operations exist if you figure in
>> a little
>> epsilon. Note that although a very small number like 1e-10
>> works most
>> of the time, epsilon should really be proportional to the
>> size of the
>> arguments.
>
> The epsilon solution has already been proposed, but as I understand this
> (correct me if I'm wrong) it wouldn't work either:
>
> > From: Zach Laine
>
> > Yet another use case would be "close enough is good enough". If the
> > bounds are within a user-defined epsilon of either boundary.
>
> If I understand correctly, this does not solve the problem either. Let's
> assume you have two values: x and y, where x = y + eps (eps being the
> user-defined margin of error). One comparison of x and y would indicate their
> equality (the difference is not greater than eps), while another one might not
> if x got truncated in the meantime (and y didn't).
>

I tried to suggest a way in which the library can deal with this here:
http://tinyurl.com/6hlb8o

Do you find problems with that strategy?

Stjepan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk