Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2008-04-29 09:06:18


 

>-----Original Message-----
>From: boost-bounces_at_[hidden]
>[mailto:boost-bounces_at_[hidden]] On Behalf Of John Maddock
>Sent: 29 April 2008 11:16
>To: Boost mailing list
>Subject: [boost] [Math/nextafter] A question of naming functions...
>
>Folks I'm looking for some good names for some functions I'm
>on the brink of
>adding to Boost.Math (all in namespace boost::math::):
>
>T nextafter(T val, T dir)
>
>Returns the next representable floating point value to "val" in the
>direction of "dir". This name is basically fixed, since it's
>the one that C99 uses.

Wrinkles nose - but you're right - can't change this nasty name.

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

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

Paul

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