Updated sgn documentation to reveal behaviour for signed zeros
Include expanded example set to show behaviour for infs
This commit is contained in:
parent
7abdaee224
commit
1f3a18d637
|
@ -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?]{
|
||||
|
|
Loading…
Reference in New Issue
Block a user