Skip to content

Instantly share code, notes, and snippets.

@KristofferC
Created September 20, 2015 15:13
Show Gist options
  • Save KristofferC/8c2be24cb47c189cc5ec to your computer and use it in GitHub Desktop.
Save KristofferC/8c2be24cb47c189cc5ec to your computer and use it in GitHub Desktop.
diff --git a/doc/stdlib/arrays.rst b/doc/stdlib/arrays.rst
index 3f855a4..2bb990d 100644
--- a/doc/stdlib/arrays.rst
+++ b/doc/stdlib/arrays.rst
@@ -119,9 +119,9 @@ Basic functions
.. Docstring generated from Julia source
- Returns a tuple of subscripts into an array with dimensions ``dims``\ , corresponding to the linear index ``index``\ .
+ Returns a tuple of subscripts into an array with dimensions ``dims``, corresponding to the linear index ``index``
- **Example**: ``i, j, ... = ind2sub(size(A), indmax(A))`` provides the indices of the maximum element
+ **Example** ``i, j, ... = ind2sub(size(A), indmax(A))`` provides the indices of the maximum element
.. function:: ind2sub(a, index) -> subscripts
diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst
index 931f92c..4f56344 100644
--- a/doc/stdlib/base.rst
+++ b/doc/stdlib/base.rst
@@ -400,15 +400,19 @@ All Objects
.. Docstring generated from Julia source
- If the argument is a type, return a "larger" type (for numeric types, this will be a type with at least as much range and precision as the argument, and usually more). Otherwise the argument ``x`` is converted to ``widen(typeof(x))``\ .
+ If the argument is a type, return a "larger" type (for numeric types, this will be
+ a type with at least as much range and precision as the argument, and usually more).
+ Otherwise the argument ``x`` is converted to ``widen(typeof(x))``.
.. doctest::
- julia> widen(Int32)
- Int64
+ julia> widen(Int32)
+ Int64
- julia> widen(1.5f0)
- 1.5
+ .. doctest::
+
+ julia> widen(1.5f0)
+ 1.5
.. function:: identity(x)
@@ -525,26 +529,27 @@ Types
.. Docstring generated from Julia source
- The byte offset of each field of a type relative to the data start. For example, we could use it in the following manner to summarize information about a struct type:
+ The byte offset of each field of a type relative to the data start. For example, we could use it
+ in the following manner to summarize information about a struct type:
.. doctest::
- julia> structinfo(T) = [zip(fieldoffsets(T),fieldnames(T),T.types)...];
-
- julia> structinfo(StatStruct)
- 12-element Array{Tuple{Int64,Symbol,DataType},1}:
- (0,:device,UInt64)
- (8,:inode,UInt64)
- (16,:mode,UInt64)
- (24,:nlink,Int64)
- (32,:uid,UInt64)
- (40,:gid,UInt64)
- (48,:rdev,UInt64)
- (56,:size,Int64)
- (64,:blksize,Int64)
- (72,:blocks,Int64)
- (80,:mtime,Float64)
- (88,:ctime,Float64)
+ julia> structinfo(T) = [zip(fieldoffsets(T),fieldnames(T),T.types)...];
+
+ julia> structinfo(StatStruct)
+ 12-element Array{Tuple{Int64,Symbol,DataType},1}:
+ (0,:device,UInt64)
+ (8,:inode,UInt64)
+ (16,:mode,UInt64)
+ (24,:nlink,Int64)
+ (32,:uid,UInt64)
+ (40,:gid,UInt64)
+ (48,:rdev,UInt64)
+ (56,:size,Int64)
+ (64,:blksize,Int64)
+ (72,:blocks,Int64)
+ (80,:mtime,Float64)
+ (88,:ctime,Float64)
.. function:: fieldtype(T, name::Symbol | index::Int)
@@ -563,15 +568,15 @@ Types
.. Docstring generated from Julia source
- Return ``true`` if ``T`` is a "plain data" type, meaning it is immutable and contains no references to other values. Typical examples are numeric types such as ``UInt8``\ , ``Float64``\ , and ``Complex{Float64}``\ .
+ Return ``true`` if ``T`` is a "plain data" type, meaning it is immutable and contains no references to other values. Typical examples are numeric types such as ``UInt8``, ``Float64``, and ``Complex{Float64}``.
.. doctest::
- julia> isbits(Complex{Float64})
- true
+ julia> isbits(Complex{Float64})
+ true
- julia> isbits(Complex)
- false
+ julia> isbits(Complex)
+ false
.. function:: isleaftype(T)
@@ -641,15 +646,15 @@ Generic Functions
.. doctest::
- julia> function f(x, y)
- x + y
- end;
+ julia> function f(x, y)
+ x + y
+ end;
- julia> applicable(f, 1)
- false
+ julia> applicable(f, 1)
+ false
- julia> applicable(f, 1, 2)
- true
+ julia> applicable(f, 1, 2)
+ true
.. function:: invoke(f, (types...), args...)
@@ -665,8 +670,8 @@ Generic Functions
.. doctest::
- julia> [1:5;] |> x->x.^2 |> sum |> inv
- 0.01818181818181818
+ julia> [1:5;] |> x->x.^2 |> sum |> inv
+ 0.01818181818181818
.. function:: call(x, args...)
@@ -868,25 +873,36 @@ System
.. Docstring generated from Julia source
- Create a pipeline from a data source to a destination. The source and destination can be commands, I/O streams, strings, or results of other ``pipeline`` calls. At least one argument must be a command. Strings refer to filenames. When called with more than two arguments, they are chained together from left to right. For example ``pipeline(a,b,c)`` is equivalent to ``pipeline(pipeline(a,b),c)``\ . This provides a more concise way to specify multi-stage pipelines.
+ Create a pipeline from a data source to a destination. The source and destination can
+ be commands, I/O streams, strings, or results of other ``pipeline`` calls. At least one
+ argument must be a command. Strings refer to filenames.
+ When called with more than two arguments, they are chained together from left to right.
+ For example ``pipeline(a,b,c)`` is equivalent to ``pipeline(pipeline(a,b),c)``. This provides a more
+ concise way to specify multi-stage pipelines.
**Examples**:
-
* ``run(pipeline(`ls`, `grep xyz`))``
* ``run(pipeline(`ls`, "out.txt"))``
* ``run(pipeline("out.txt", `grep xyz`))``
+
.. function:: pipeline(command; stdin, stdout, stderr, append=false)
.. Docstring generated from Julia source
- Redirect I/O to or from the given ``command``\ . Keyword arguments specify which of the command's streams should be redirected. ``append`` controls whether file output appends to the file. This is a more general version of the 2-argument ``pipeline`` function. ``pipeline(from, to)`` is equivalent to ``pipeline(from, stdout=to)`` when ``from`` is a command, and to ``pipe(to, stdin=from)`` when ``from`` is another kind of data source.
+ Redirect I/O to or from the given ``command``. Keyword arguments specify which of
+ the command's streams should be redirected. ``append`` controls whether file output
+ appends to the file.
+ This is a more general version of the 2-argument ``pipeline`` function.
+ ``pipeline(from, to)`` is equivalent to ``pipeline(from, stdout=to)`` when ``from`` is a
+ command, and to ``pipe(to, stdin=from)`` when ``from`` is another kind of
+ data source.
**Examples**:
-
* ``run(pipeline(`dothings`, stdout="out.txt", stderr="errs.txt"))``
* ``run(pipeline(`update`, stdout="log.txt", append=true))``
+
.. function:: gethostname() -> AbstractString
.. Docstring generated from Julia source
diff --git a/doc/stdlib/collections.rst b/doc/stdlib/collections.rst
index ab19b3c..d046422 100644
--- a/doc/stdlib/collections.rst
+++ b/doc/stdlib/collections.rst
@@ -63,14 +63,14 @@ type.
.. doctest::
- julia> a = ["a", "b", "c"];
+ julia> a = ["a", "b", "c"];
- julia> for (index, value) in enumerate(a)
- println("$index $value")
- end
- 1 a
- 2 b
- 3 c
+ julia> for (index, value) in enumerate(a)
+ println("$index $value")
+ end
+ 1 a
+ 2 b
+ 3 c
.. function:: rest(iter, state)
@@ -136,11 +136,11 @@ General Collections
.. doctest::
- julia> isempty([])
- true
+ julia> isempty([])
+ true
- julia> isempty([1 2 3])
- false
+ julia> isempty([1 2 3])
+ false
.. function:: empty!(collection) -> collection
@@ -162,8 +162,8 @@ General Collections
.. doctest::
- julia> endof([1,2,4])
- 3
+ julia> endof([1,2,4])
+ 3
Fully implemented by:
@@ -483,13 +483,13 @@ Iterable Collections
.. Docstring generated from Julia source
- Test whether all elements of a boolean collection are ``true``\ .
+ Test whether all elements of a boolean collection are ``true``.
.. function:: all(A, dims)
.. Docstring generated from Julia source
- Test whether all values along the given dimensions of an array are ``true``\ .
+ Test whether all values along the given dimensions of an array are ``true``.
.. function:: all!(r, A)
@@ -513,32 +513,33 @@ Iterable Collections
.. Docstring generated from Julia source
- Determine whether predicate ``p`` returns ``true`` for all elements of ``itr``\ .
+ Determine whether predicate ``p`` returns ``true`` for all elements of ``itr``.
.. doctest::
- julia> all(i->(4<=i<=6), [4,5,6])
- true
+ julia> all(i->(4<=i<=6), [4,5,6])
+ true
.. function:: map(f, c...) -> collection
.. Docstring generated from Julia source
- Transform collection ``c`` by applying ``f`` to each element. For multiple collection arguments, apply ``f`` elementwise.
+ Transform collection ``c`` by applying ``f`` to each element.
+ For multiple collection arguments, apply ``f`` elementwise.
.. doctest::
- julia> map((x) -> x * 2, [1, 2, 3])
- 3-element Array{Int64,1}:
- 2
- 4
- 6
+ julia> map((x) -> x * 2, [1, 2, 3])
+ 3-element Array{Int64,1}:
+ 2
+ 4
+ 6
- julia> map(+, [1, 2, 3], [10, 20, 30])
- 3-element Array{Int64,1}:
- 11
- 22
- 33
+ julia> map(+, [1, 2, 3], [10, 20, 30])
+ 3-element Array{Int64,1}:
+ 11
+ 22
+ 33
.. function:: map!(function, collection)
@@ -810,7 +811,7 @@ Given a dictionary ``D``, the syntax ``D[x]`` returns the value of key ``x`` (if
.. Docstring generated from Julia source
- Delete and return the mapping for ``key`` if it exists in ``collection``\ , otherwise return ``default``\ , or throw an error if default is not specified.
+ Delete and return the mapping for ``key`` if it exists in ``collection``, otherwise return ``default``, or throw an error if default is not specified.
.. function:: keys(collection)
@@ -832,27 +833,27 @@ Given a dictionary ``D``, the syntax ``D[x]`` returns the value of key ``x`` (if
.. doctest::
- julia> a = Dict("foo" => 0.0, "bar" => 42.0)
- Dict{ASCIIString,Float64} with 2 entries:
- "bar" => 42.0
- "foo" => 0.0
+ julia> a = Dict("foo" => 0.0, "bar" => 42.0)
+ Dict{ASCIIString,Float64} with 2 entries:
+ "bar" => 42.0
+ "foo" => 0.0
- julia> b = Dict(utf8("baz") => 17, utf8("bar") => 4711)
- Dict{UTF8String,Int64} with 2 entries:
- "bar" => 4711
- "baz" => 17
+ julia> b = Dict(utf8("baz") => 17, utf8("bar") => 4711)
+ Dict{UTF8String,Int64} with 2 entries:
+ "bar" => 4711
+ "baz" => 17
- julia> merge(a, b)
- Dict{UTF8String,Float64} with 3 entries:
- "bar" => 4711.0
- "baz" => 17.0
- "foo" => 0.0
+ julia> merge(a, b)
+ Dict{UTF8String,Float64} with 3 entries:
+ "bar" => 4711.0
+ "baz" => 17.0
+ "foo" => 0.0
- julia> merge(b, a)
- Dict{UTF8String,Float64} with 3 entries:
- "bar" => 42.0
- "baz" => 17.0
- "foo" => 0.0
+ julia> merge(b, a)
+ Dict{UTF8String,Float64} with 3 entries:
+ "bar" => 42.0
+ "baz" => 17.0
+ "foo" => 0.0
.. function:: merge!(collection, others...)
@@ -1035,217 +1036,233 @@ Dequeues
.. doctest::
- julia> A=[1, 2, 3, 4, 5, 6]
- 6-element Array{Int64,1}:
- 1
- 2
- 3
- 4
- 5
- 6
+ julia> A=[1, 2, 3, 4, 5, 6]
+ 6-element Array{Int64,1}:
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
- julia> pop!(A)
- 6
+ julia> pop!(A)
+ 6
- julia> A
- 5-element Array{Int64,1}:
- 1
- 2
- 3
- 4
- 5
+ julia> A
+ 5-element Array{Int64,1}:
+ 1
+ 2
+ 3
+ 4
+ 5
.. function:: unshift!(collection, items...) -> collection
.. Docstring generated from Julia source
- Insert one or more ``items`` at the beginning of ``collection``\ .
+ Insert one or more ``items`` at the beginning of ``collection``.
.. doctest::
- julia> unshift!([1, 2, 3, 4], 5, 6)
- 6-element Array{Int64,1}:
- 5
- 6
- 1
- 2
- 3
- 4
+ julia> unshift!([1, 2, 3, 4], 5, 6)
+ 6-element Array{Int64,1}:
+ 5
+ 6
+ 1
+ 2
+ 3
+ 4
.. function:: shift!(collection) -> item
.. Docstring generated from Julia source
- Remove the first ``item`` from ``collection``\ .
+ Remove the first ``item`` from ``collection``.
.. doctest::
- julia> A = [1, 2, 3, 4, 5, 6]
- 6-element Array{Int64,1}:
- 1
- 2
- 3
- 4
- 5
- 6
+ julia> A = [1, 2, 3, 4, 5, 6]
+ 6-element Array{Int64,1}:
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
- julia> shift!(A)
- 1
+ julia> shift!(A)
+ 1
- julia> A
- 5-element Array{Int64,1}:
- 2
- 3
- 4
- 5
- 6
+ julia> A
+ 5-element Array{Int64,1}:
+ 2
+ 3
+ 4
+ 5
+ 6
.. function:: insert!(collection, index, item)
.. Docstring generated from Julia source
- Insert an ``item`` into ``collection`` at the given ``index``\ . ``index`` is the index of ``item`` in the resulting ``collection``\ .
+ Insert an ``item`` into ``collection`` at the given ``index``.
+ ``index`` is the index of ``item`` in the resulting ``collection``.
.. doctest::
- julia> insert!([6, 5, 4, 2, 1], 4, 3)
- 6-element Array{Int64,1}:
- 6
- 5
- 4
- 3
- 2
- 1
+ julia> insert!([6, 5, 4, 2, 1], 4, 3)
+ 6-element Array{Int64,1}:
+ 6
+ 5
+ 4
+ 3
+ 2
+ 1
.. function:: deleteat!(collection, index)
.. Docstring generated from Julia source
- Remove the item at the given ``index`` and return the modified ``collection``\ . Subsequent items are shifted to fill the resulting gap.
+ Remove the item at the given ``index`` and return the modified ``collection``.
+ Subsequent items are shifted to fill the resulting gap.
.. doctest::
- julia> deleteat!([6, 5, 4, 3, 2, 1], 2)
- 5-element Array{Int64,1}:
- 6
- 4
- 3
- 2
- 1
+ julia> deleteat!([6, 5, 4, 3, 2, 1], 2)
+ 5-element Array{Int64,1}:
+ 6
+ 4
+ 3
+ 2
+ 1
+
.. function:: deleteat!(collection, itr)
.. Docstring generated from Julia source
- Remove the items at the indices given by ``itr``\ , and return the modified ``collection``\ . Subsequent items are shifted to fill the resulting gap. ``itr`` must be sorted and unique.
+ Remove the items at the indices given by ``itr``, and return the modified ``collection``.
+ Subsequent items are shifted to fill the resulting gap. ``itr`` must be sorted and unique.
.. doctest::
- julia> deleteat!([6, 5, 4, 3, 2, 1], 1:2:5)
- 3-element Array{Int64,1}:
- 5
- 3
- 1
+ julia> deleteat!([6, 5, 4, 3, 2, 1], 1:2:5)
+ 3-element Array{Int64,1}:
+ 5
+ 3
+ 1
+
+ .. doctest::
- julia> deleteat!([6, 5, 4, 3, 2, 1], (2, 2))
- ERROR: ArgumentError: indices must be unique and sorted
- in deleteat! at array.jl:543
+ julia> deleteat!([6, 5, 4, 3, 2, 1], (2, 2))
+ ERROR: ArgumentError: indices must be unique and sorted
+ in deleteat! at array.jl:543
.. function:: splice!(collection, index, [replacement]) -> item
.. Docstring generated from Julia source
- Remove the item at the given index, and return the removed item. Subsequent items are shifted down to fill the resulting gap. If specified, replacement values from an ordered collection will be spliced in place of the removed item.
+ Remove the item at the given index, and return the removed item. Subsequent items
+ are shifted down to fill the resulting gap. If specified, replacement values from
+ an ordered collection will be spliced in place of the removed item.
.. doctest::
- julia> A = [6, 5, 4, 3, 2, 1]; splice!(A, 5)
- 2
-
- julia> A
- 5-element Array{Int64,1}:
- 6
- 5
- 4
- 3
- 1
+ julia> A = [6, 5, 4, 3, 2, 1]; splice!(A, 5)
+ 2
- julia> splice!(A, 5, -1)
- 1
+ julia> A
+ 5-element Array{Int64,1}:
+ 6
+ 5
+ 4
+ 3
+ 1
- julia> A
- 5-element Array{Int64,1}:
- 6
- 5
- 4
- 3
- -1
+ julia> splice!(A, 5, -1)
+ 1
- julia> splice!(A, 1, [-1, -2, -3])
+ julia> A
+ 5-element Array{Int64,1}:
6
+ 5
+ 4
+ 3
+ -1
+
+ julia> splice!(A, 1, [-1, -2, -3])
+ 6
- julia> A
- 7-element Array{Int64,1}:
- -1
- -2
- -3
- 5
- 4
- 3
- -1
+ julia> A
+ 7-element Array{Int64,1}:
+ -1
+ -2
+ -3
+ 5
+ 4
+ 3
+ -1
- To insert ``replacement`` before an index ``n`` without removing any items, use ``splice!(collection, n:n-1, replacement)``\ .
+ To insert ``replacement`` before an index ``n`` without removing any items, use
+ ``splice!(collection, n:n-1, replacement)``.
.. function:: splice!(collection, range, [replacement]) -> items
.. Docstring generated from Julia source
- Remove items in the specified index range, and return a collection containing the removed items. Subsequent items are shifted down to fill the resulting gap. If specified, replacement values from an ordered collection will be spliced in place of the removed items.
+ Remove items in the specified index range, and return a collection containing the
+ removed items. Subsequent items are shifted down to fill the resulting gap.
+ If specified, replacement values from an ordered collection will be spliced in place
+ of the removed items.
- To insert ``replacement`` before an index ``n`` without removing any items, use ``splice!(collection, n:n-1, replacement)``\ .
+ To insert ``replacement`` before an index ``n`` without removing any items, use
+ ``splice!(collection, n:n-1, replacement)``.
.. doctest::
- julia> splice!(A, 4:3, 2)
- 0-element Array{Int64,1}
+ julia> splice!(A, 4:3, 2)
+ 0-element Array{Int64,1}
- julia> A
- 8-element Array{Int64,1}:
- -1
- -2
- -3
- 2
- 5
- 4
- 3
- -1
+ julia> A
+ 8-element Array{Int64,1}:
+ -1
+ -2
+ -3
+ 2
+ 5
+ 4
+ 3
+ -1
.. function:: resize!(collection, n) -> collection
.. Docstring generated from Julia source
- Resize ``collection`` to contain ``n`` elements. If ``n`` is smaller than the current collection length, the first ``n`` elements will be retained. If ``n`` is larger, the new elements are not guaranteed to be initialized.
+ Resize ``collection`` to contain ``n`` elements.
+ If ``n`` is smaller than the current collection length, the first ``n``
+ elements will be retained. If ``n`` is larger, the new elements are not
+ guaranteed to be initialized.
.. doctest::
- julia> resize!([6, 5, 4, 3, 2, 1], 3)
- 3-element Array{Int64,1}:
- 6
- 5
- 4
+ julia> resize!([6, 5, 4, 3, 2, 1], 3)
+ 3-element Array{Int64,1}:
+ 6
+ 5
+ 4
.. code-block:: julia
- julia> resize!([6, 5, 4, 3, 2, 1], 8)
- 8-element Array{Int64,1}:
- 6
- 5
- 4
- 3
- 2
- 1
- 0
- 0
+ julia> resize!([6, 5, 4, 3, 2, 1], 8)
+ 8-element Array{Int64,1}:
+ 6
+ 5
+ 4
+ 3
+ 2
+ 1
+ 0
+ 0
.. function:: append!(collection, collection2) -> collection.
@@ -1281,15 +1298,15 @@ Dequeues
.. Docstring generated from Julia source
- Insert the elements of ``items`` to the beginning of ``collection``\ .
+ Insert the elements of ``items`` to the beginning of ``collection``.
.. doctest::
- julia> prepend!([3],[1,2])
- 3-element Array{Int64,1}:
- 1
- 2
- 3
+ julia> prepend!([3],[1,2])
+ 3-element Array{Int64,1}:
+ 1
+ 2
+ 3
Fully implemented by:
diff --git a/doc/stdlib/linalg.rst b/doc/stdlib/linalg.rst
index 5f38802..4016c8d 100644
--- a/doc/stdlib/linalg.rst
+++ b/doc/stdlib/linalg.rst
@@ -25,7 +25,7 @@ Linear algebra functions in Julia are largely implemented by calling functions f
Matrix division using a polyalgorithm. For input matrices ``A`` and ``B``, the result ``X`` is such that ``A*X == B`` when ``A`` is square. The solver that is used depends upon the structure of ``A``. A direct solver is used for upper or lower triangular ``A``. For Hermitian ``A`` (equivalent to symmetric ``A`` for non-complex ``A``) the ``BunchKaufman`` factorization is used. Otherwise an LU factorization is used. For rectangular ``A`` the result is the minimum-norm least squares solution computed by a pivoted QR factorization of ``A`` and a rank estimate of ``A`` based on the R factor.
- When ``A`` is sparse, a similar polyalgorithm is used. For indefinite matrices, the ``LDLt`` factorization does not use pivoting during the numerical factorization and therefore the procedure can fail even for invertible matrices.
+ When ``A`` is sparse, a similar polyalgorithm is used. For indefinite matrices, the LDLt factorization does not use pivoting during the numerical factorization and therefore the procedure can fail even for invertible matrices.
.. function:: dot(x, y)
⋅(x,y)
@@ -653,11 +653,10 @@ Linear algebra functions in Julia are largely implemented by calling functions f
.. Docstring generated from Julia source
.. math::
+ \kappa_S(M, p) & = \left\Vert \left\vert M \right\vert \left\vert M^{-1} \right\vert \right\Vert_p \\
+ \kappa_S(M, x, p) & = \left\Vert \left\vert M \right\vert \left\vert M^{-1} \right\vert \left\vert x \right\vert \right\Vert_p
- \kappa_S(M, p) & = \left\Vert \left\vert M \right\vert \left\vert M^{-1} \right\vert \right\Vert_p \\
- \kappa_S(M, x, p) & = \left\Vert \left\vert M \right\vert \left\vert M^{-1} \right\vert \left\vert x \right\vert \right\Vert_p
-
- Skeel condition number :math:`\kappa_S` of the matrix ``M``\ , optionally with respect to the vector ``x``\ , as computed using the operator ``p``\ -norm. ``p`` is ``Inf`` by default, if not provided. Valid values for ``p`` are ``1``\ , ``2``\ , or ``Inf``\ .
+ Skeel condition number :math:`\kappa_S` of the matrix ``M``, optionally with respect to the vector ``x``, as computed using the operator ``p``-norm. ``p`` is ``Inf`` by default, if not provided. Valid values for ``p`` are ``1``, ``2``, or ``Inf``.
This quantity is also known in the literature as the Bauer condition number, relative condition number, or componentwise relative condition number.
diff --git a/doc/stdlib/math.rst b/doc/stdlib/math.rst
index b17c8b2..416caf2 100644
--- a/doc/stdlib/math.rst
+++ b/doc/stdlib/math.rst
@@ -34,7 +34,8 @@ Mathematical Operators
.. Docstring generated from Julia source
- Multiplication operator. ``x*y*z*...`` calls this function with all arguments, i.e. ``*(x, y, z, ...)``\ .
+ Multiplication operator. ``x*y*z*...`` calls this function with all arguments, i.e.
+ ``*(x, y, z, ...)``.
.. _/:
.. function:: /(x, y)
@@ -425,16 +426,17 @@ Mathematical Operators
.. Docstring generated from Julia source
- Calculates the matrix-matrix or matrix-vector product :math:`A⋅B` and stores the result in :math:`Y`\ , overwriting the existing value of :math:`Y`\ .
+ Calculates the matrix-matrix or matrix-vector product *A B* and stores the
+ result in *Y*, overwriting the existing value of *Y*.
.. doctest::
- julia> A=[1.0 2.0; 3.0 4.0]; B=[1.0 1.0; 1.0 1.0]; A_mul_B!(B, A, B);
+ julia> A=[1.0 2.0; 3.0 4.0]; B=[1.0 1.0; 1.0 1.0]; A_mul_B!(B, A, B);
- julia> B
- 2x2 Array{Float64,2}:
- 3.0 3.0
- 7.0 7.0
+ julia> B
+ 2x2 Array{Float64,2}:
+ 3.0 3.0
+ 7.0 7.0
.. function:: A_mul_Bc(A, B)
@@ -587,13 +589,13 @@ Mathematical Functions
.. Docstring generated from Julia source
- Compute :math:`\sin(\pi x)` more accurately than ``sin(pi*x)``\ , especially for large ``x``\ .
+ Compute :math:`\sin(\pi x)` more accurately than ``sin(pi*x)``, especially for large ``x``.
.. function:: cospi(x)
.. Docstring generated from Julia source
- Compute :math:`\cos(\pi x)` more accurately than ``cos(pi*x)``\ , especially for large ``x``\ .
+ Compute :math:`\cos(\pi x)` more accurately than ``cos(pi*x)``, especially for large ``x``.
.. function:: sinh(x)
@@ -785,13 +787,14 @@ Mathematical Functions
.. Docstring generated from Julia source
- Compute :math:`\sin(\pi x) / (\pi x)` if :math:`x \neq 0`\ , and :math:`1` if :math:`x = 0`\ .
+ Compute :math:`\sin(\pi x) / (\pi x)` if :math:`x \neq 0`, and :math:`1` if :math:`x = 0`.
.. function:: cosc(x)
.. Docstring generated from Julia source
- Compute :math:`\cos(\pi x) / x - \sin(\pi x) / (\pi x^2)` if :math:`x \neq 0`\ , and :math:`0` if :math:`x = 0`\ . This is the derivative of ``sinc(x)``\ .
+ Compute :math:`\cos(\pi x) / x - \sin(\pi x) / (\pi x^2)` if :math:`x \neq 0`, and :math:`0`
+ if :math:`x = 0`. This is the derivative of ``sinc(x)``.
.. function:: deg2rad(x)
@@ -849,31 +852,32 @@ Mathematical Functions
.. Docstring generated from Julia source
- Return ``(x,exp)`` such that ``x`` has a magnitude in the interval :math:`[1/2, 1)` or 0, and val = :math:`x \times 2^{exp}`\ .
+ Return ``(x,exp)`` such that ``x`` has a magnitude in the interval :math:`[1/2, 1)` or 0,
+ and val = :math:`x \times 2^{exp}`.
.. function:: exp(x)
.. Docstring generated from Julia source
- Compute :math:`e^x`\ .
+ Compute :math:`e^x`
.. function:: exp2(x)
.. Docstring generated from Julia source
- Compute :math:`2^x`\ .
+ Compute :math:`2^x`
.. function:: exp10(x)
.. Docstring generated from Julia source
- Compute :math:`10^x`\ .
+ Compute :math:`10^x`
.. function:: ldexp(x, n)
.. Docstring generated from Julia source
- Compute :math:`x \times 2^n`\ .
+ Compute :math:`x \times 2^n`
.. function:: modf(x)
@@ -885,7 +889,7 @@ Mathematical Functions
.. Docstring generated from Julia source
- Accurately compute :math:`e^x-1`\ .
+ Accurately compute :math:`e^x-1`
.. function:: round([T,] x, [digits, [base]], [r::RoundingMode])
@@ -1088,7 +1092,7 @@ Mathematical Functions
.. Docstring generated from Julia source
- Return zero if ``x==0`` and :math:`x/|x|` otherwise (i.e., ±1 for real ``x``\ ).
+ Return zero if ``x==0`` and :math:`x/|x|` otherwise (i.e., ±1 for real ``x``).
.. function:: signbit(x)
@@ -1106,7 +1110,7 @@ Mathematical Functions
.. Docstring generated from Julia source
- Return :math:`\sqrt{x}`\ . Throws ``DomainError`` for negative ``Real`` arguments. Use complex negative arguments instead. The prefix operator ``√`` is equivalent to ``sqrt``\ .
+ Return :math:`\sqrt{x}`. Throws ``DomainError`` for negative ``Real`` arguments. Use complex negative arguments instead. The prefix operator ``√`` is equivalent to ``sqrt``.
.. function:: isqrt(n)
@@ -1118,49 +1122,59 @@ Mathematical Functions
.. Docstring generated from Julia source
- Return :math:`x^{1/3}`\ . The prefix operator ``∛`` is equivalent to ``cbrt``\ .
+ Return :math:`x^{1/3}`. The prefix operator ``∛`` is equivalent to ``cbrt``.
.. function:: erf(x)
.. Docstring generated from Julia source
- Compute the error function of ``x``\ , defined by :math:`\frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt` for arbitrary complex ``x``\ .
+ Compute the error function of ``x``, defined by
+ :math:`\frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt`
+ for arbitrary complex ``x``.
.. function:: erfc(x)
.. Docstring generated from Julia source
- Compute the complementary error function of ``x``\ , defined by :math:`1 - \operatorname{erf}(x)`\ .
+ Compute the complementary error function of ``x``,
+ defined by :math:`1 - \operatorname{erf}(x)`.
.. function:: erfcx(x)
.. Docstring generated from Julia source
- Compute the scaled complementary error function of ``x``\ , defined by :math:`e^{x^2} \operatorname{erfc}(x)`\ . Note also that :math:`\operatorname{erfcx}(-ix)` computes the Faddeeva function :math:`w(x)`\ .
+ Compute the scaled complementary error function of ``x``,
+ defined by :math:`e^{x^2} \operatorname{erfc}(x)`. Note
+ also that :math:`\operatorname{erfcx}(-ix)` computes the
+ Faddeeva function :math:`w(x)`.
.. function:: erfi(x)
.. Docstring generated from Julia source
- Compute the imaginary error function of ``x``\ , defined by :math:`-i \operatorname{erf}(ix)`\ .
+ Compute the imaginary error function of ``x``,
+ defined by :math:`-i \operatorname{erf}(ix)`.
.. function:: dawson(x)
.. Docstring generated from Julia source
- Compute the Dawson function (scaled imaginary error function) of ``x``\ , defined by :math:`\frac{\sqrt{\pi}}{2} e^{-x^2} \operatorname{erfi}(x)`\ .
+ Compute the Dawson function (scaled imaginary error function) of ``x``,
+ defined by :math:`\frac{\sqrt{\pi}}{2} e^{-x^2} \operatorname{erfi}(x)`.
.. function:: erfinv(x)
.. Docstring generated from Julia source
- Compute the inverse error function of a real ``x``\ , defined by :math:`\operatorname{erf}(\operatorname{erfinv}(x)) = x`\ .
+ Compute the inverse error function of a real ``x``,
+ defined by :math:`\operatorname{erf}(\operatorname{erfinv}(x)) = x`.
.. function:: erfcinv(x)
.. Docstring generated from Julia source
- Compute the inverse error complementary function of a real ``x``\ , defined by :math:`\operatorname{erfc}(\operatorname{erfcinv}(x)) = x`\ .
+ Compute the inverse error complementary function of a real ``x``,
+ defined by :math:`\operatorname{erfc}(\operatorname{erfcinv}(x)) = x`.
.. function:: real(z)
@@ -1196,7 +1210,7 @@ Mathematical Functions
.. Docstring generated from Julia source
- Return :math:`\exp(iz)`\ .
+ Return :math:`\exp(iz)`.
.. function:: binomial(n,k)
@@ -1225,14 +1239,14 @@ Mathematical Functions
.. Docstring generated from Julia source
- Compute the prime factorization of an integer ``n``\ . Returns a dictionary. The keys of the dictionary correspond to the factors, and hence are of the same type as ``n``\ . The value associated with each key indicates the number of times the factor appears in the factorization.
+ Compute the prime factorization of an integer ``n``. Returns a dictionary. The keys of the dictionary correspond to the factors, and hence are of the same type as ``n``. The value associated with each key indicates the number of times the factor appears in the factorization.
.. doctest::
- julia> factor(100) # == 2*2*5*5
- Dict{Int64,Int64} with 2 entries:
- 2 => 2
- 5 => 2
+ julia> factor(100) # == 2*2*5*5
+ Dict{Int64,Int64} with 2 entries:
+ 2 => 2
+ 5 => 2
.. function:: gcd(x,y)
@@ -1300,25 +1314,25 @@ Mathematical Functions
.. Docstring generated from Julia source
- Next integer not less than ``n`` that can be written as :math:`\prod k_i^{p_i}` for integers :math:`p_1`\ , :math:`p_2`\ , etc.
+ Next integer not less than ``n`` that can be written as :math:`\prod k_i^{p_i}` for integers :math:`p_1`, :math:`p_2`, etc.
.. function:: prevprod([k_1,k_2,...], n)
.. Docstring generated from Julia source
- Previous integer not greater than ``n`` that can be written as :math:`\prod k_i^{p_i}` for integers :math:`p_1`\ , :math:`p_2`\ , etc.
+ Previous integer not greater than ``n`` that can be written as :math:`\prod k_i^{p_i}` for integers :math:`p_1`, :math:`p_2`, etc.
.. function:: invmod(x,m)
.. Docstring generated from Julia source
- Take the inverse of ``x`` modulo ``m``\ : ``y`` such that :math:`xy = 1 \pmod m`\ .
+ Take the inverse of ``x`` modulo ``m``: ``y`` such that :math:`xy = 1 \pmod m`
.. function:: powermod(x, p, m)
.. Docstring generated from Julia source
- Compute :math:`x^p \pmod m`\ .
+ Compute :math:`x^p \pmod m`
.. function:: gamma(x)
@@ -1368,115 +1382,115 @@ Mathematical Functions
.. Docstring generated from Julia source
- The ``k``\ th derivative of the Airy function :math:`\operatorname{Ai}(x)`\ .
+ kth derivative of the Airy function :math:`\operatorname{Ai}(x)`.
.. function:: airyai(x)
.. Docstring generated from Julia source
- Airy function :math:`\operatorname{Ai}(x)`\ .
+ Airy function :math:`\operatorname{Ai}(x)`.
.. function:: airyprime(x)
.. Docstring generated from Julia source
- Airy function derivative :math:`\operatorname{Ai}'(x)`\ .
+ Airy function derivative :math:`\operatorname{Ai}'(x)`.
.. function:: airyaiprime(x)
.. Docstring generated from Julia source
- Airy function derivative :math:`\operatorname{Ai}'(x)`\ .
+ Airy function derivative :math:`\operatorname{Ai}'(x)`.
.. function:: airybi(x)
.. Docstring generated from Julia source
- Airy function :math:`\operatorname{Bi}(x)`\ .
+ Airy function :math:`\operatorname{Bi}(x)`.
.. function:: airybiprime(x)
.. Docstring generated from Julia source
- Airy function derivative :math:`\operatorname{Bi}'(x)`\ .
+ Airy function derivative :math:`\operatorname{Bi}'(x)`.
.. function:: airyx(k,x)
.. Docstring generated from Julia source
- scaled ``k``\ th derivative of the Airy function, return :math:`\operatorname{Ai}(x) e^{\frac{2}{3} x \sqrt{x}}` for ``k == 0 || k == 1``\ , and :math:`\operatorname{Ai}(x) e^{- \left| \operatorname{Re} \left( \frac{2}{3} x \sqrt{x} \right) \right|}` for ``k == 2 || k == 3``\ .
+ scaled kth derivative of the Airy function, return :math:`\operatorname{Ai}(x) e^{\frac{2}{3} x \sqrt{x}}` for ``k == 0 || k == 1``, and :math:`\operatorname{Ai}(x) e^{- \left| \operatorname{Re} \left( \frac{2}{3} x \sqrt{x} \right) \right|}` for ``k == 2 || k == 3``.
.. function:: besselj0(x)
.. Docstring generated from Julia source
- Bessel function of the first kind of order 0, :math:`J_0(x)`\ .
+ Bessel function of the first kind of order 0, :math:`J_0(x)`.
.. function:: besselj1(x)
.. Docstring generated from Julia source
- Bessel function of the first kind of order 1, :math:`J_1(x)`\ .
+ Bessel function of the first kind of order 1, :math:`J_1(x)`.
.. function:: besselj(nu, x)
.. Docstring generated from Julia source
- Bessel function of the first kind of order ``nu``\ , :math:`J_\nu(x)`\ .
+ Bessel function of the first kind of order ``nu``, :math:`J_\nu(x)`.
.. function:: besseljx(nu, x)
.. Docstring generated from Julia source
- Scaled Bessel function of the first kind of order ``nu``\ , :math:`J_\nu(x) e^{- | \operatorname{Im}(x) |}`\ .
+ Scaled Bessel function of the first kind of order ``nu``, :math:`J_\nu(x) e^{- | \operatorname{Im}(x) |}`.
.. function:: bessely0(x)
.. Docstring generated from Julia source
- Bessel function of the second kind of order 0, :math:`Y_0(x)`\ .
+ Bessel function of the second kind of order 0, :math:`Y_0(x)`.
.. function:: bessely1(x)
.. Docstring generated from Julia source
- Bessel function of the second kind of order 1, :math:`Y_1(x)`\ .
+ Bessel function of the second kind of order 1, :math:`Y_1(x)`.
.. function:: bessely(nu, x)
.. Docstring generated from Julia source
- Bessel function of the second kind of order ``nu``\ , :math:`Y_\nu(x)`\ .
+ Bessel function of the second kind of order ``nu``, :math:`Y_\nu(x)`.
.. function:: besselyx(nu, x)
.. Docstring generated from Julia source
- Scaled Bessel function of the second kind of order ``nu``\ , :math:`Y_\nu(x) e^{- | \operatorname{Im}(x) |}`\ .
+ Scaled Bessel function of the second kind of order ``nu``, :math:`Y_\nu(x) e^{- | \operatorname{Im}(x) |}`.
.. function:: hankelh1(nu, x)
.. Docstring generated from Julia source
- Bessel function of the third kind of order ``nu``\ , :math:`H^{(1)}_\nu(x)`\ .
+ Bessel function of the third kind of order ``nu``, :math:`H^{(1)}_\nu(x)`.
.. function:: hankelh1x(nu, x)
.. Docstring generated from Julia source
- Scaled Bessel function of the third kind of order ``nu``\ , :math:`H^{(1)}_\nu(x) e^{-x i}`\ .
+ Scaled Bessel function of the third kind of order ``nu``, :math:`H^{(1)}_\nu(x) e^{-x i}`.
.. function:: hankelh2(nu, x)
.. Docstring generated from Julia source
- Bessel function of the third kind of order ``nu``\ , :math:`H^{(2)}_\nu(x)`\ .
+ Bessel function of the third kind of order ``nu``, :math:`H^{(2)}_\nu(x)`.
.. function:: hankelh2x(nu, x)
.. Docstring generated from Julia source
- Scaled Bessel function of the third kind of order ``nu``\ , :math:`H^{(2)}_\nu(x) e^{x i}`\ .
+ Scaled Bessel function of the third kind of order ``nu``, :math:`H^{(2)}_\nu(x) e^{x i}`.
.. function:: besselh(nu, k, x)
@@ -1488,55 +1502,56 @@ Mathematical Functions
.. Docstring generated from Julia source
- Modified Bessel function of the first kind of order ``nu``\ , :math:`I_\nu(x)`\ .
+ Modified Bessel function of the first kind of order ``nu``, :math:`I_\nu(x)`.
.. function:: besselix(nu, x)
.. Docstring generated from Julia source
- Scaled modified Bessel function of the first kind of order ``nu``\ , :math:`I_\nu(x) e^{- | \operatorname{Re}(x) |}`\ .
+ Scaled modified Bessel function of the first kind of order ``nu``, :math:`I_\nu(x) e^{- | \operatorname{Re}(x) |}`.
.. function:: besselk(nu, x)
.. Docstring generated from Julia source
- Modified Bessel function of the second kind of order ``nu``\ , :math:`K_\nu(x)`\ .
+ Modified Bessel function of the second kind of order ``nu``, :math:`K_\nu(x)`.
.. function:: besselkx(nu, x)
.. Docstring generated from Julia source
- Scaled modified Bessel function of the second kind of order ``nu``\ , :math:`K_\nu(x) e^x`\ .
+ Scaled modified Bessel function of the second kind of order ``nu``, :math:`K_\nu(x) e^x`.
.. function:: beta(x, y)
.. Docstring generated from Julia source
- Euler integral of the first kind :math:`\operatorname{B}(x,y) = \Gamma(x)\Gamma(y)/\Gamma(x+y)`\ .
+ Euler integral of the first kind :math:`\operatorname{B}(x,y) = \Gamma(x)\Gamma(y)/\Gamma(x+y)`.
.. function:: lbeta(x, y)
.. Docstring generated from Julia source
- Natural logarithm of the absolute value of the beta function :math:`\log(|\operatorname{B}(x,y)|)`\ .
+ Natural logarithm of the absolute value of the beta function :math:`\log(|\operatorname{B}(x,y)|)`.
.. function:: eta(x)
.. Docstring generated from Julia source
- Dirichlet eta function :math:`\eta(s) = \sum^\infty_{n=1}(-)^{n-1}/n^{s}`\ .
+ Dirichlet eta function :math:`\eta(s) = \sum^\infty_{n=1}(-)^{n-1}/n^{s}`.
.. function:: zeta(s)
.. Docstring generated from Julia source
- Riemann zeta function :math:`\zeta(s)`\ .
+ Riemann zeta function :math:`\zeta(s)`.
.. function:: zeta(s, z)
.. Docstring generated from Julia source
- Hurwitz zeta function :math:`\zeta(s, z)`\ . (This is equivalent to the Riemann zeta function :math:`\zeta(s)` for the case of ``z=1``\ .)
+ Hurwitz zeta function :math:`\zeta(s, z)`. (This is equivalent to
+ the Riemann zeta function :math:`\zeta(s)` for the case of ``z=1``.)
.. function:: ndigits(n, b)
@@ -1554,7 +1569,11 @@ Mathematical Functions
.. Docstring generated from Julia source
- Evaluate the polynomial :math:`\sum_k c[k] z^{k-1}` for the coefficients ``c[1]``\ , ``c[2]``\ , ...; that is, the coefficients are given in ascending order by power of ``z``\ . This macro expands to efficient inline code that uses either Horner's method or, for complex ``z``\ , a more efficient Goertzel-like algorithm.
+ Evaluate the polynomial :math:`\sum_k c[k] z^{k-1}` for the
+ coefficients ``c[1]``, ``c[2]``, ...; that is, the coefficients are
+ given in ascending order by power of ``z``. This macro expands to
+ efficient inline code that uses either Horner's method or, for
+ complex ``z``, a more efficient Goertzel-like algorithm.
Statistics
----------
@@ -1760,11 +1779,11 @@ multi-threading. Use ``FFTW.set_num_threads(np)`` to use ``np`` threads.
.. math::
- \operatorname{IDFT}(A)[k] = \frac{1}{\operatorname{length}(A)}
- \sum_{n=1}^{\operatorname{length}(A)} \exp\left(+i\frac{2\pi (n-1)(k-1)}
- {\operatorname{length}(A)} \right) A[n].
+ \operatorname{IDFT}(A)[k] = \frac{1}{\operatorname{length}(A)}
+ \sum_{n=1}^{\operatorname{length}(A)} \exp\left(+i\frac{2\pi (n-1)(k-1)}
+ {\operatorname{length}(A)} \right) A[n].
- A multidimensional inverse FFT simply performs this operation along each transformed dimension of ``A``\ .
+ A multidimensional inverse FFT simply performs this operation along each transformed dimension of ``A``.
.. function:: ifft!(A [, dims])
diff --git a/doc/stdlib/numbers.rst b/doc/stdlib/numbers.rst
index ca5fe33..bb42555 100644
--- a/doc/stdlib/numbers.rst
+++ b/doc/stdlib/numbers.rst
@@ -100,15 +100,18 @@ Data Formats
.. Docstring generated from Julia source
- Extract the ``significand(s)`` (a.k.a. mantissa), in binary representation, of a floating-point number or array. If ``x`` is a non-zero finite number, than the result will be a number of the same type on the interval :math:`[1,2)`\ . Otherwise ``x`` is returned.
+ Extract the ``significand(s)`` (a.k.a. mantissa), in binary representation, of
+ a floating-point number or array. If ``x`` is a non-zero finite number,
+ than the result will be a number of the same type on the interval
+ :math:`[1,2)`. Otherwise ``x`` is returned.
.. doctest::
- julia> significand(15.2)/15.2
- 0.125
+ julia> significand(15.2)/15.2
+ 0.125
- julia> significand(15.2)*8
- 15.2
+ julia> significand(15.2)*8
+ 15.2
.. function:: exponent(x) -> Int
@@ -283,15 +286,16 @@ General Number Functions and Constants
.. Docstring generated from Julia source
- Create a Float32 from ``x``\ . If ``x`` is not exactly representable then ``mode`` determines how ``x`` is rounded.
+ Create a Float32 from ``x``. If ``x`` is not exactly representable then
+ ``mode`` determines how ``x`` is rounded.
.. doctest::
- julia> Float32(1/3, RoundDown)
- 0.3333333f0
+ julia> Float32(1/3, RoundDown)
+ 0.3333333f0
- julia> Float32(1/3, RoundUp)
- 0.33333334f0
+ julia> Float32(1/3, RoundUp)
+ 0.33333334f0
See ``get_rounding`` for available rounding modes.
@@ -299,15 +303,16 @@ General Number Functions and Constants
.. Docstring generated from Julia source
- Create a Float64 from ``x``\ . If ``x`` is not exactly representable then ``mode`` determines how ``x`` is rounded.
+ Create a Float64 from ``x``. If ``x`` is not exactly representable then
+ ``mode`` determines how ``x`` is rounded.
.. doctest::
- julia> Float64(pi, RoundDown)
- 3.141592653589793
+ julia> Float64(pi, RoundDown)
+ 3.141592653589793
- julia> Float64(pi, RoundUp)
- 3.1415926535897936
+ julia> Float64(pi, RoundUp)
+ 3.1415926535897936
See ``get_rounding`` for available rounding modes.
@@ -403,67 +408,67 @@ Integers
.. Docstring generated from Julia source
- Number of ones in the binary representation of ``x``\ .
+ Number of ones in the binary representation of ``x``.
.. doctest::
- julia> count_ones(7)
- 3
+ julia> count_ones(7)
+ 3
.. function:: count_zeros(x::Integer) -> Integer
.. Docstring generated from Julia source
- Number of zeros in the binary representation of ``x``\ .
+ Number of zeros in the binary representation of ``x``.
.. doctest::
- julia> count_zeros(Int32(2 ^ 16 - 1))
- 16
+ julia> count_zeros(Int32(2 ^ 16 - 1))
+ 16
.. function:: leading_zeros(x::Integer) -> Integer
.. Docstring generated from Julia source
- Number of zeros leading the binary representation of ``x``\ .
+ Number of zeros leading the binary representation of ``x``.
.. doctest::
- julia> leading_zeros(Int32(1))
- 31
+ julia> leading_zeros(Int32(1))
+ 31
.. function:: leading_ones(x::Integer) -> Integer
.. Docstring generated from Julia source
- Number of ones leading the binary representation of ``x``\ .
+ Number of ones leading the binary representation of ``x``.
.. doctest::
- julia> leading_ones(UInt32(2 ^ 32 - 2))
- 31
+ julia> leading_ones(UInt32(2 ^ 32 - 2))
+ 31
.. function:: trailing_zeros(x::Integer) -> Integer
.. Docstring generated from Julia source
- Number of zeros trailing the binary representation of ``x``\ .
+ Number of zeros trailing the binary representation of ``x``.
.. doctest::
- julia> trailing_zeros(2)
- 1
+ julia> trailing_zeros(2)
+ 1
.. function:: trailing_ones(x::Integer) -> Integer
.. Docstring generated from Julia source
- Number of ones trailing the binary representation of ``x``\ .
+ Number of ones trailing the binary representation of ``x``.
.. doctest::
- julia> trailing_ones(3)
- 2
+ julia> trailing_ones(3)
+ 2
.. function:: isprime(x::Integer) -> Bool
@@ -473,19 +478,22 @@ Integers
.. doctest::
- julia> isprime(3)
- true
+ julia> isprime(3)
+ true
.. function:: isprime(x::BigInt, [reps = 25]) -> Bool
.. Docstring generated from Julia source
- Probabilistic primality test. Returns ``true`` if ``x`` is prime; and ``false`` if ``x`` is not prime with high probability. The false positive rate is about ``0.25^reps``\ . ``reps = 25`` is considered safe for cryptographic applications (Knuth, Seminumerical Algorithms).
+ Probabilistic primality test. Returns ``true`` if ``x`` is prime; and
+ ``false`` if ``x`` is not prime with high probability. The false positive
+ rate is about ``0.25^reps``. ``reps = 25`` is considered safe for
+ cryptographic applications (Knuth, Seminumerical Algorithms).
.. doctest::
- julia> isprime(big(3))
- true
+ julia> isprime(big(3))
+ true
.. function:: primes([lo,] hi)
@@ -507,11 +515,11 @@ Integers
.. doctest::
- julia> isodd(9)
- true
+ julia> isodd(9)
+ true
- julia> isodd(10)
- false
+ julia> isodd(10)
+ false
.. function:: iseven(x::Integer) -> Bool
@@ -521,11 +529,11 @@ Integers
.. doctest::
- julia> iseven(9)
- false
+ julia> iseven(9)
+ false
- julia> iseven(10)
- true
+ julia> iseven(10)
+ true
BigFloats
---------
@@ -603,12 +611,13 @@ As ``BigInt`` represents unbounded integers, the interval must be specified (e.g
.. Docstring generated from Julia source
- Pick a random element or array of random elements from the set of values specified by ``S``\ ; ``S`` can be
+ Pick a random element or array of random elements from the set of values specified by ``S``; ``S`` can be
- * an indexable collection (for example ``1:n`` or ``['x','y','z']``\ ), or
- * a type: the set of values to pick from is then equivalent to ``typemin(S):typemax(S)`` for integers (this is not applicable to ``BigInt``\ ), and to :math:`[0, 1)` for floating point numbers;
+ * an indexable collection (for example ``1:n`` or ``['x','y','z']``), or
- ``S`` defaults to ``Float64``\ .
+ * a type: the set of values to pick from is then equivalent to ``typemin(S):typemax(S)`` for integers (this is not applicable to ``BigInt``), and to :math:`[0, 1)` for floating point numbers;
+
+ ``S`` defaults to ``Float64``.
.. function:: rand!([rng], A, [coll])
diff --git a/doc/stdlib/parallel.rst b/doc/stdlib/parallel.rst
index 6075736..34b2360 100644
--- a/doc/stdlib/parallel.rst
+++ b/doc/stdlib/parallel.rst
@@ -274,27 +274,38 @@ General Parallel Computing Support
.. Docstring generated from Julia source
- Block the current task until some event occurs, depending on the type of the argument:
+ Block the current task until some event occurs, depending on the type
+ of the argument:
- * ``RemoteRef``\ : Wait for a value to become available for the specified remote reference.
- * ``Channel``\ : Wait for a value to be appended to the channel.
- * ``Condition``\ : Wait for ``notify`` on a condition.
- * ``Process``\ : Wait for a process or process chain to exit. The ``exitcode`` field of a process can be used to determine success or failure.
- * ``Task``\ : Wait for a ``Task`` to finish, returning its result value. If the task fails with an exception, the exception is propagated (re-thrown in the task that called ``wait``\ ).
- * ``RawFD``\ : Wait for changes on a file descriptor (see ``poll_fd`` for keyword arguments and return code)
+ * ``RemoteRef``: Wait for a value to become available for the specified remote reference.
- If no argument is passed, the task blocks for an undefined period. If the task's state is set to ``:waiting``\ , it can only be restarted by an explicit call to ``schedule`` or ``yieldto``\ . If the task's state is ``:runnable``\ , it might be restarted unpredictably.
+ * ``Channel``: Wait for a value to be appended to the channel.
- Often ``wait`` is called within a ``while`` loop to ensure a waited-for condition is met before proceeding.
+ * ``Condition``: Wait for ``notify`` on a condition.
+
+ * ``Process``: Wait for a process or process chain to exit. The ``exitcode`` field of a process can be used to determine success or failure.
+
+ * ``Task``: Wait for a ``Task`` to finish, returning its result value. If the task fails with an exception, the exception is propagated (re-thrown in the task that called ``wait``).
+
+ * ``RawFD``: Wait for changes on a file descriptor (see `poll_fd` for keyword arguments and return code)
+
+ If no argument is passed, the task blocks for an undefined period. If the task's
+ state is set to ``:waiting``, it can only be restarted by an explicit call to
+ ``schedule`` or ``yieldto``. If the task's state is ``:runnable``, it might be
+ restarted unpredictably.
+
+ Often ``wait`` is called within a ``while`` loop to ensure a waited-for condition
+ is met before proceeding.
.. function:: fetch(x)
.. Docstring generated from Julia source
- Waits and fetches a value from ``x`` depending on the type of ``x``\ . Does not remove the item fetched:
+ Waits and fetches a value from ``x`` depending on the type of ``x``. Does not remove the item fetched:
+
+ * ``RemoteRef``: Wait for and get the value of a remote reference. If the remote value is an exception, throws a ``RemoteException`` which captures the remote exception and backtrace.
- * ``RemoteRef``\ : Wait for and get the value of a remote reference. If the remote value is an exception, throws a ``RemoteException`` which captures the remote exception and backtrace.
- * ``Channel`` : Wait for and get the first available item from the channel.
+ * ``Channel`` : Wait for and get the first available item from the channel.
.. function:: remotecall_wait(id, func, args...)
@@ -352,8 +363,10 @@ General Parallel Computing Support
Closes a channel. An exception is thrown by:
- * ``put!`` on a closed channel.
- * ``take!`` and ``fetch`` on an empty, closed channel.
+ - ``put!`` on a closed channel.
+
+ - ``take!`` and ``fetch`` on an empty, closed channel.
+
.. function:: RemoteRef()
diff --git a/doc/stdlib/strings.rst b/doc/stdlib/strings.rst
index cdefe2f..1617de1 100644
--- a/doc/stdlib/strings.rst
+++ b/doc/stdlib/strings.rst
@@ -24,19 +24,19 @@
.. doctest::
- julia> "Hello " * "world"
- "Hello world"
+ julia> "Hello " * "world"
+ "Hello world"
.. function:: ^(s, n)
.. Docstring generated from Julia source
- Repeat ``n`` times the string ``s``\ . The ``repeat`` function is an alias to this operator.
+ Repeat ``n`` times the string ``s``. The ``^`` operator is an alias to this function.
.. doctest::
- julia> "Test "^3
- "Test Test Test "
+ julia> "Test "^3
+ "Test Test Test "
.. function:: string(xs...)
@@ -132,22 +132,34 @@
.. Docstring generated from Julia source
- Normalize the string ``s`` according to one of the four "normal forms" of the Unicode standard: ``normalform`` can be ``:NFC``\ , ``:NFD``\ , ``:NFKC``\ , or ``:NFKD``\ . Normal forms C (canonical composition) and D (canonical decomposition) convert different visually identical representations of the same abstract string into a single canonical form, with form C being more compact. Normal forms KC and KD additionally canonicalize "compatibility equivalents": they convert characters that are abstractly similar but visually distinct into a single canonical choice (e.g. they expand ligatures into the individual characters), with form KC being more compact.
-
- Alternatively, finer control and additional transformations may be be obtained by calling ``normalize_string(s; keywords...)``\ , where any number of the following boolean keywords options (which all default to ``false`` except for ``compose``\ ) are specified:
-
- * ``compose=false``\ : do not perform canonical composition
- * ``decompose=true``\ : do canonical decomposition instead of canonical composition (``compose=true`` is ignored if present)
- * ``compat=true``\ : compatibility equivalents are canonicalized
- * ``casefold=true``\ : perform Unicode case folding, e.g. for case-insensitive string comparison
- * ``newline2lf=true``\ , ``newline2ls=true``\ , or ``newline2ps=true``\ : convert various newline sequences (LF, CRLF, CR, NEL) into a linefeed (LF), line-separation (LS), or paragraph-separation (PS) character, respectively
- * ``stripmark=true``\ : strip diacritical marks (e.g. accents)
- * ``stripignore=true``\ : strip Unicode's "default ignorable" characters (e.g. the soft hyphen or the left-to-right marker)
- * ``stripcc=true``\ : strip control characters; horizontal tabs and form feeds are converted to spaces; newlines are also converted to spaces unless a newline-conversion flag was specified
- * ``rejectna=true``\ : throw an error if unassigned code points are found
- * ``stable=true``\ : enforce Unicode Versioning Stability
-
- For example, NFKC corresponds to the options ``compose=true, compat=true, stable=true``\ .
+ Normalize the string ``s`` according to one of the four "normal
+ forms" of the Unicode standard: ``normalform`` can be ``:NFC``,
+ ``:NFD``, ``:NFKC``, or ``:NFKD``. Normal forms C (canonical
+ composition) and D (canonical decomposition) convert different
+ visually identical representations of the same abstract string into
+ a single canonical form, with form C being more compact. Normal
+ forms KC and KD additionally canonicalize "compatibility
+ equivalents": they convert characters that are abstractly similar
+ but visually distinct into a single canonical choice (e.g. they expand
+ ligatures into the individual characters), with form KC being more compact.
+
+ Alternatively, finer control and additional transformations may be
+ be obtained by calling ``normalize_string(s; keywords...)``, where
+ any number of the following boolean keywords options (which all default
+ to ``false`` except for ``compose``) are specified:
+
+ * ``compose=false``: do not perform canonical composition
+ * ``decompose=true``: do canonical decomposition instead of canonical composition (``compose=true`` is ignored if present)
+ * ``compat=true``: compatibility equivalents are canonicalized
+ * ``casefold=true``: perform Unicode case folding, e.g. for case-insensitive string comparison
+ * ``newline2lf=true``, ``newline2ls=true``, or ``newline2ps=true``: convert various newline sequences (LF, CRLF, CR, NEL) into a linefeed (LF), line-separation (LS), or paragraph-separation (PS) character, respectively
+ * ``stripmark=true``: strip diacritical marks (e.g. accents)
+ * ``stripignore=true``: strip Unicode's "default ignorable" characters (e.g. the soft hyphen or the left-to-right marker)
+ * ``stripcc=true``: strip control characters; horizontal tabs and form feeds are converted to spaces; newlines are also converted to spaces unless a newline-conversion flag was specified
+ * ``rejectna=true``: throw an error if unassigned code points are found
+ * ``stable=true``: enforce Unicode Versioning Stability
+
+ For example, NFKC corresponds to the options ``compose=true, compat=true, stable=true``.
.. function:: graphemes(s) -> iterator over substrings of s
diff --git a/doc/stdlib/test.rst b/doc/stdlib/test.rst
index cfd9bf5..456f337 100644
--- a/doc/stdlib/test.rst
+++ b/doc/stdlib/test.rst
@@ -158,7 +158,7 @@ Macros
.. Docstring generated from Julia source
- Test that the expression ``ex`` throws an exception of type ``extype`` and calls the current handler to handle the result.
+ Test that the expression ``ex`` throws an exception of type ``extype`` and calls the current handler to handle the result. The default handler returns the exception if it is of the expected type.
.. function:: @test_approx_eq(a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment