Subject: Re: bug#7877: sleep 5 -4

From: Paul Eggert <[email-masked]>
Date: Tue, 25 Jan 2011 01:27:49 -0800

OK, so it's late, but I can't resist:

First, 'sleep' does accept one number that's negative
in an IEEE-754 sense, namely, "sleep -- -0.0".

Second, due to rounding error, 'sleep' does accept some
numbers that are negative in a mathematical sense, e.g.,
"sleep -- -1e1000" works.

Third, there's nothing intrinsically wrong with 'sleep'
accepting negative numbers.  All that POSIX
requires is that 'sleep' must sleep for at *least* the
amount of time specified.  So, if "sleep -- -1.0"
is treated like "sleep 0", then it's conforming to
that requirement of POSIX (obviously it doesn't
conform to the other requirement that the operand be
a nonnegative decimal integer; but it's a valid extension
that is consistent with POSIX).

(Have I written enough to tempt you to extend 'sleep'
to allow negative numbers?  :-)