Boost logo

Boost :

From: hervebronnimann_at_[hidden]
Date: 2008-05-05 13:48:30

I have one qualm about next / prior / rep or discrete distance names: they do not indicate at all that the operation is tied to *floating-point* representation! Imho, a major omission. Especially discrete_distance is bad from that point of view. That is why I suggested and still prefer next_float / prior_float / floating_distance names.
Perhaps next_float_distance is even better.

Regarding ulp_distance, I might also work but the name is misleading, I think. It would likely be understood by someone relying on name rather than reading docs to mean: the number of times you have to add ulp to x to obtain y???

Regarding ulp(T), the comment is wrong: that is not the ulp_distance between x and next(x), that would be one. Or else I misunderstood ulp_distance. Back to square one...

Just a few personal thoughts, please feel free to disregard.

Sent via BlackBerry from T-Mobile

-----Original Message-----
From: John Maddock <john_at_[hidden]>

Date: Mon, 05 May 2008 11:48:22
Subject: Re: [boost] [Math/nextafter] A question of naming functions...

So, it looks like so far we have:


and either of

representation_distance(a, b);
discrete_distance(a, b);

Whilst I'm normally all in favour of
"long_meaningful_names_with_underscores", next() and prior() do look OK to
me: especially so long as they're in namespace boost::math.

Like Paul, I'm still looking for the right "killer name" for the *_distance
function, I quite like "maddock_metric" but I doubt anyone will know what
that means :-)

Given that this function is inherently related to the "units in the last
place" metric, I wonder if we can compose a name from that?

Maybe extending the API slightly how about:

T upl_distance(T, T); // "representation distance"
T relative_distance(T, T); // AKA relative error.
T ulp(T); // distance between arg and next(arg)


Thanks, John.

Unsubscribe & other changes:

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