Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2008-04-29 14:25:15


 

>-----Original Message-----
>From: boost-bounces_at_[hidden]
>[mailto:boost-bounces_at_[hidden]] On Behalf Of Kevin Lynch
>Sent: 29 April 2008 17:35
>To: boost_at_[hidden]
>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_at_[hidden]
 

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