This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients lemburg, mark.dickinson, rhettinger, stutzbach, tim.peters, vstinner
Date 2020-01-10.20:03:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm not opposed to some form of this by any means, but I fear there's some bikeshedding to go through, both on the name and the functionality (one function with two arguments, or two functions each taking a single argument?).

C 99 prescribes "nextafter" and "nexttoward" (which is pretty much the same as "nextafter" if you don't care about the distinction between float, double and long double).

IEEE 754, on the other hand, requires instead nextUp and nextDown, which take a single argument and move towards +inf or -inf (respectively).

Python's Decimal type has a two-argument next_toward method.

NumPy has nextafter.

Java provides all three of nextUp, nextDown and nextAfter.

For sure implementing nextafter is easiest, since we can just wrap the C version. That doesn't *necessarily* make it the right variant to go for.

(Annoyingly enough, none of these is actually what I tend to want in practice, which is "next larger" and "next smaller" functions, or more precisely, nextAwayFromZero and nextTowardsZero functions. nextTowardsZero is of course a special case of nextafter, but nextAwayFromZero doesn't match any of these.)
Date User Action Args
2020-01-10 20:03:38mark.dickinsonsetrecipients: + mark.dickinson, lemburg, tim.peters, rhettinger, vstinner, stutzbach
2020-01-10 20:03:38mark.dickinsonsetmessageid: <>
2020-01-10 20:03:38mark.dickinsonlinkissue39288 messages
2020-01-10 20:03:38mark.dickinsoncreate