Skip to content

Commit

Permalink
Reference signbit from cispi and vice versa
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed May 11, 2020
1 parent fd3a59f commit a5e3bfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions base/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,10 @@ This function also accepts integer or boolean arguments, and then
returns integer results. This allows calculating ``(-1)^s``
conveniently and efficiently.
`cispi` is related to `signbit`, and allows decomposing integers into
sign bit and absolute value: ``cispi(signbit(n)) * abs(n) == n``. For
boolean values, it is also, ``signbit(cispi(b)) == b``.
`cispi` is related to [`signbit`](@ref), and allows decomposing
integers into sign bit and absolute value: ``cispi(signbit(n)) *
abs(n) == n``. For boolean values, it is also, ``signbit(cispi(b)) ==
b``.
# Examples
```jldoctest
Expand Down
4 changes: 2 additions & 2 deletions base/number.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ copy(x::Number) = x # some code treats numbers as collection-like
Returns `true` if the value of the sign of `x` is negative, otherwise `false`.
Related to `signbit` is `cispi` (which calculates `(-1)^n`). This
allows decomposing integers into sign bit and absolute value:
Related to `signbit` is [`cispi`](@ref) (which calculates `(-1)^n`).
This allows decomposing integers into sign bit and absolute value:
``cispi(signbit(n)) * abs(n) == n``. For boolean values, it is also,
``signbit(cispi(b)) == b``.
Expand Down

0 comments on commit a5e3bfa

Please sign in to comment.