
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Kevin Lynch Sent: 29 April 2008 17:35 To: boost@lists.boost.org Subject: Re: [boost] [Math/nextafter] A question of naming functions...
T next_greater(T val) Returns the next representable value greater than "val".
T next_less(T val) Returns the next representable value less than "val".
pred and succ have been used elsewhere. They are shorter.
I disagree with Paul here: I prefer the longer, more descriptive names, especially in a general purpose library.
Fine - I agree - I'm only reporting what I have seen used elsewhere.
T edit_distance(T a, T b)
Returns the number of floating point representations between values a and b.
A useful function, with a technically accurate name. Works for me.
The edit bit sounds odd to me - and uses I have found are applied to *strings* when the name makes some sense - the number of typing mistakes you need to make ;-) Can you enlighten me on why it is a "technically accurate" name here? Paul PS Are we choosing names for posssible specializations of other types than floating-point? derived FP, integer, char, strings, intervals... --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com