Updated sgn documentation to reveal behaviour for signed zeros

Include expanded example set to show behaviour for infs
This commit is contained in:
Sancho McCann 2020-06-08 06:35:58 -07:00 committed by GitHub
parent 7abdaee224
commit 1f3a18d637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1293,15 +1293,19 @@ Returns @racket[(* z z)].}
@defproc[(sgn [x real?]) (or/c (=/c -1) (=/c 0) (=/c 1) +nan.0 @#,racketvalfont{+nan.f})]{
Returns the sign of @racket[x] as either @math{-1}, @math{0},
@math{1}, or not-a-number.
Returns the sign of @racket[x] as either @math{-1}, @math{0} (or a signed-zero variant, when
inexact), @math{1}, or not-a-number.
@mz-examples[
#:eval math-eval
(sgn 10)
(sgn -10.0)
(sgn 0)
(sgn -0.0)
(sgn +0.0)
(sgn +nan.0)
(sgn +inf.0)
(sgn -inf.0)
]}
@defproc[(conjugate [z number?]) number?]{