Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-04-29 14:33:16


Paul A Bristow wrote:
>> T edit_distance(T a, T b)
>> Returns the number of floating point representations between values a and b.
> Definitely useful.
> Not convinced by this name, but I'll think about it.
> Signed sounds obvious but I suspect choice may be more complicated than it seems.

It's more intuitive to get the unsigned value from the signed than the
other way around.
std::abs(edit_distance(a, b))


copysign(edit_distance(a, b), b - a)

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at