Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2008-05-06 08:02:50


 

>-----Original Message-----
>From: boost-bounces_at_[hidden]
>[mailto:boost-bounces_at_[hidden]] On Behalf Of John Maddock
>Sent: 05 May 2008 11:48
>To: boost_at_[hidden]
>Subject: Re: [boost] [Math/nextafter] A question of naming functions...
>
>So, it looks like so far we have:
>
>next(val)
>prior(val)
>
>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 :-)

I can guess, but I may be peculiar ;-)

>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)

If this is really limited to floating_point's ulp, I'm puzzlied as to what is your objection to

T float_distance(T, T)

?

Paul

PS Shocking, but there are people who don't know what ulp means, but still understand enough about floating point to conceive a
least significant bit change.

float_distance will mean more to them?

---
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
pbristow_at_[hidden]
 

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