On Thu, Aug 4, 2016 at 9:24 AM, Alexander Belopolsky <alexander.belopolsky@gmail.com> wrote:
The behavior of each variant is subtly different from the others.
Having this function in stdlib would allow standardizing on one
well-documented (and hopefully well-motivated) variant.

exactly -- not every small function should be in the stdlib -- but there is a place for it when there are multiple subtly different way to implement it.

regardless of the outcome of the NaN issue -- I think the "one obvious way to do it" should be the math.clip() (or math.clamp()) function.

-CHB



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov