Skip to content

Commit

Permalink
More documentation for scalar math functions
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Feb 12, 2013
1 parent 42ee1fe commit 86f617d
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 2 deletions.
64 changes: 63 additions & 1 deletion doc/helpdb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1503,7 +1503,13 @@ collection[key...] = value
"),

(E"Mathematical Functions",E"",E"rem %",E"rem %
(E"Mathematical Functions",E"Base",E"rem",E"rem()
Remainder after division
"),

(E"Mathematical Functions",E"Base",E"%",E"%()
Remainder after division
Expand Down Expand Up @@ -1830,6 +1836,12 @@ collection[key...] = value
"),

(E"Mathematical Functions",E"Base",E"radians2degrees",E"radians2degrees(x)
Convert \"x\" from radians to degrees
"),

(E"Mathematical Functions",E"Base",E"hypot",E"hypot(x, y)
Compute the \\sqrt{(x^2+y^2)} without undue overflow or underflow
Expand Down Expand Up @@ -1903,6 +1915,12 @@ collection[key...] = value
"),

(E"Mathematical Functions",E"Base",E"square",E"square(x)
Compute x^2
"),

(E"Mathematical Functions",E"Base",E"round",E"round(x[, digits[, base]]) -> FloatingPoint
\"round(x)\" returns the nearest integer to \"x\". \"round(x,
Expand Down Expand Up @@ -2080,6 +2098,13 @@ collection[key...] = value
"),

(E"Mathematical Functions",E"Base",E"reim",E"reim(z)
Return both the real and imaginary parts of the complex number
\"z\"
"),

(E"Mathematical Functions",E"Base",E"conj",E"conj(z)
Compute the complex conjugate of a complex number \"z\"
Expand Down Expand Up @@ -2406,6 +2431,14 @@ airyaiprime(x)
"),

(E"Data Formats",E"Base",E"uint",E"uint(x)
Convert a number or array to the default unsigned integer type on
your platform. Alternatively, \"x\" can be a string, which is
parsed as an unsigned integer.
"),

(E"Data Formats",E"Base",E"integer",E"integer(x)
Convert a number or array to integer type. If \"x\" is already of
Expand All @@ -2420,6 +2453,18 @@ airyaiprime(x)
"),

(E"Data Formats",E"Base",E"signed",E"signed(x)
Convert a number to a signed integer
"),

(E"Data Formats",E"Base",E"unsigned",E"unsigned(x)
Convert a number to an unsigned integer
"),

(E"Data Formats",E"Base",E"int8",E"int8(x)
Convert a number or array to \"Int8\" data type
Expand Down Expand Up @@ -2500,6 +2545,16 @@ airyaiprime(x)
"),

(E"Data Formats",E"Base",E"significand",E"significand(x)
Extract the significand(s) (a.k.a. mantissa), in binary
representation, of a floating-point number or array.
For example, \"significand(15.2)/15.2 == 0.125\", and
\"significand(15.2)*8 == 15.2\"
"),

(E"Data Formats",E"Base",E"float64_valued",E"float64_valued(x::Rational)
True if \"x\" can be losslessly represented as a \"Float64\" data
Expand Down Expand Up @@ -3413,6 +3468,13 @@ airyaiprime(x)
"),

(E"Linear Algebra",E"Base",E"sqrtm",E"sqrtm(A)
Compute the matrix square root of \"A\". If \"B = sqrtm(A)\", then
\"B*B == A\" within roundoff error.
"),

(E"Linear Algebra",E"Base",E"eig",E"eig(A) -> D, V
Compute eigenvalues and eigenvectors of A
Expand Down
40 changes: 39 additions & 1 deletion doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,11 @@ Mathematical Functions

Modulus after division, returning in the range [0,m)

.. function:: rem %
.. function:: rem

Remainder after division

.. function:: %

Remainder after division

Expand Down Expand Up @@ -1062,6 +1066,10 @@ Mathematical Functions

Convert ``x`` from degrees to radians

.. function:: radians2degrees(x)

Convert ``x`` from radians to degrees

.. function:: hypot(x, y)

Compute the :math:`\sqrt{(x^2+y^2)}` without undue overflow or underflow
Expand Down Expand Up @@ -1111,6 +1119,10 @@ Mathematical Functions

Accurately compute :math:`e^x-1`

.. function:: square(x)

Compute :math:`x^2`

.. function:: round(x, [digits, [base]]) -> FloatingPoint

``round(x)`` returns the nearest integer to ``x``. ``round(x, digits)`` rounds to the specified number of digits after the decimal place, or before if negative, e.g., ``round(pi,2)`` is ``3.14``. ``round(x, digits, base)`` rounds using a different base, defaulting to 10, e.g., ``round(pi, 3, 2)`` is ``3.125``.
Expand Down Expand Up @@ -1223,6 +1235,10 @@ Mathematical Functions

Return the imaginary part of the complex number ``z``

.. function:: reim(z)

Return both the real and imaginary parts of the complex number ``z``

.. function:: conj(z)

Compute the complex conjugate of a complex number ``z``
Expand Down Expand Up @@ -1431,6 +1447,10 @@ Data Formats

Convert a number or array to the default integer type on your platform. Alternatively, ``x`` can be a string, which is parsed as an integer.

.. function:: uint(x)

Convert a number or array to the default unsigned integer type on your platform. Alternatively, ``x`` can be a string, which is parsed as an unsigned integer.

.. function:: integer(x)

Convert a number or array to integer type. If ``x`` is already of integer type it is unchanged, otherwise it converts it to the default integer type on your platform.
Expand All @@ -1439,6 +1459,14 @@ Data Formats

Test whether a number or array is of integer type

.. function:: signed(x)

Convert a number to a signed integer

.. function:: unsigned(x)

Convert a number to an unsigned integer

.. function:: int8(x)

Convert a number or array to ``Int8`` data type
Expand Down Expand Up @@ -1491,6 +1519,12 @@ Data Formats

Convert a number, array, or string to a ``FloatingPoint`` data type. For numeric data, the smallest suitable ``FloatingPoint`` type is used. For strings, it converts to ``Float64``.

.. function:: significand(x)

Extract the significand(s) (a.k.a. mantissa), in binary representation, of a floating-point number or array.

For example, ``significand(15.2)/15.2 == 0.125``, and ``significand(15.2)*8 == 15.2``

.. function:: float64_valued(x::Rational)

True if ``x`` can be losslessly represented as a ``Float64`` data type
Expand Down Expand Up @@ -2077,6 +2111,10 @@ Linear algebra functions in Julia are largely implemented by calling functions f

Perform Q'*A efficiently, where Q is a an orthogonal matrix defined as the product of k elementary reflectors from the QR decomposition.
.. function:: sqrtm(A)

Compute the matrix square root of ``A``. If ``B = sqrtm(A)``, then ``B*B == A`` within roundoff error.

.. function:: eig(A) -> D, V

Compute eigenvalues and eigenvectors of A
Expand Down

0 comments on commit 86f617d

Please sign in to comment.