[Python-ideas] Consider adding clip or clamp function to math

Ian Kelly ian.g.kelly at gmail.com
Sun Jul 31 09:10:59 EDT 2016


On Sun, Jul 31, 2016 at 2:19 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> I'm not sure how your version would work with NANs, and I haven't
> bothered to try it to find out, but I like this version:

Answer:

py> min(10, float('nan'))
10


More information about the Python-ideas mailing list