From 96ef72a5327b3fdc4516655d36d264bfd8e87775 Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Wed, 9 Sep 2015 21:32:02 -0400 Subject: [PATCH] Convert some more docstrings to Markdown --- base/docs/helpdb.jl | 394 +++++++++++++++++-------------------- doc/stdlib/collections.rst | 245 +++++++++++------------ doc/stdlib/math.rst | 13 +- doc/stdlib/numbers.rst | 27 ++- doc/stdlib/strings.rst | 6 +- 5 files changed, 313 insertions(+), 372 deletions(-) diff --git a/base/docs/helpdb.jl b/base/docs/helpdb.jl index cda9e72fe9699..f9e828bfada88 100644 --- a/base/docs/helpdb.jl +++ b/base/docs/helpdb.jl @@ -4254,22 +4254,20 @@ specifies a random number generator, see :ref:`Random Numbers `. randstring doc""" -```rst -.. Float64(x [, mode::RoundingMode]) - -Create a Float64 from ``x``. If ``x`` is not exactly representable then -``mode`` determines how ``x`` is rounded. - -.. doctest:: + Float64(x [, mode::RoundingMode]) - julia> Float64(pi, RoundDown) - 3.141592653589793 +Create a Float64 from `x`. If `x` is not exactly representable then +`mode` determines how `x` is rounded. - julia> Float64(pi, RoundUp) - 3.1415926535897936 +```jl +julia> Float64(pi, RoundDown) +3.141592653589793 -See ``get_rounding`` for available rounding modes. +julia> Float64(pi, RoundUp) +3.1415926535897936 ``` + +See `get_rounding` for available rounding modes. """ Float64 @@ -4983,97 +4981,91 @@ Approximate floating point number `x` as a Rational number with components of th rationalize doc""" -```rst -.. splice!(collection, index, [replacement]) -> item + splice!(collection, index, [replacement]) -> 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 +```jldoctest +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> A - 7-element Array{Int64,1}: - -1 - -2 - -3 - 5 - 4 - 3 - -1 +julia> splice!(A, 1, [-1, -2, -3]) +6 -To insert ``replacement`` before an index ``n`` without removing any items, use -``splice!(collection, n:n-1, replacement)``. +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)`. """ splice!(collection, index, replacement = ?) doc""" -```rst -.. splice!(collection, range, [replacement]) -> items + splice!(collection, range, [replacement]) -> 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} +```jldoctest +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 ``` """ splice!(collection, range::Range, replacement) doc""" -```rst -.. endof(collection) -> Integer + endof(collection) -> Integer Returns the last index of the collection. -.. doctest:: - - julia> endof([1,2,4]) - 3 +```jldoctest +julia> endof([1,2,4]) +3 ``` """ endof @@ -5130,13 +5122,11 @@ Returns the number of stored (filled) elements in a sparse matrix. nnz doc""" -```rst -.. unshift!(collection, items...) -> collection - -Insert one or more ``items`` at the beginning of ``collection``. + unshift!(collection, items...) -> collection -.. doctest:: +Insert one or more `items` at the beginning of `collection`. +```jldoctest julia> unshift!([1, 2, 3, 4], 5, 6) 6-element Array{Int64,1}: 5 @@ -5705,24 +5695,20 @@ doc""" bkfact! doc""" -```rst -.. ^(x, y) + ^(x, y) Exponentiation operator. -``` """ Base.(:(^))(x, y) doc""" -```rst -.. ^(s, n) - -Repeat ``n`` times the string ``s``. The ``^`` operator is an alias to this function. + ^(s, n) -.. doctest:: +Repeat `n` times the string `s`. The `repeat` function is an alias to this operator. - julia> "Test "^3 - "Test Test Test " +```jldoctest +julia> "Test "^3 +"Test Test Test " ``` """ Base.(:(^))(s::String, n::Int) @@ -5902,18 +5888,16 @@ See also :func:`sortperm` sortperm! doc""" -```rst -.. isodd(x::Integer) -> Bool + isodd(x::Integer) -> Bool -Returns ``true`` if ``x`` is odd (that is, not divisible by 2), and ``false`` otherwise. +Returns `true` if `x` is odd (that is, not divisible by 2), and `false` otherwise. -.. doctest:: - - julia> isodd(9) - true +```jldoctest +julia> isodd(9) +true - julia> isodd(10) - false +julia> isodd(10) +false ``` """ isodd @@ -6029,34 +6013,32 @@ with appropriate ``op`` values: manage doc""" -```rst -.. resize!(collection, n) -> collection + resize!(collection, n) -> collection -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 +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 - -.. code-block:: julia +```jldoctest +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], 8) - 8-element Array{Int64,1}: - 6 - 5 - 4 - 3 - 2 - 1 - 0 - 0 +```jl +julia> resize!([6, 5, 4, 3, 2, 1], 8) +8-element Array{Int64,1}: + 6 + 5 + 4 + 3 + 2 + 1 + 0 + 0 ``` """ resize! @@ -6076,15 +6058,13 @@ Returns IPv4 object from ip address formatted as Integer IPv4 doc""" -```rst -.. trailing_zeros(x::Integer) -> Integer + trailing_zeros(x::Integer) -> Integer -Number of zeros trailing the binary representation of ``x``. +Number of zeros trailing the binary representation of `x`. -.. doctest:: - - julia> trailing_zeros(2) - 1 +```jldoctest +julia> trailing_zeros(2) +1 ``` """ trailing_zeros @@ -6399,18 +6379,16 @@ Bessel function of the third kind of order `nu` (Hankel function). `k` is either besselh doc""" -```rst -.. prepend!(collection, items) -> collection - -Insert the elements of ``items`` to the beginning of ``collection``. + prepend!(collection, items) -> collection -.. doctest:: +Insert the elements of `items` to the beginning of `collection`. - julia> prepend!([3],[1,2]) - 3-element Array{Int64,1}: - 1 - 2 - 3 +```jldoctest +julia> prepend!([3],[1,2]) +3-element Array{Int64,1}: + 1 + 2 + 3 ``` """ prepend! @@ -6575,21 +6553,19 @@ Return an iterator over all values in a collection. `collect(values(d))` returns values doc""" -```rst -.. A_mul_B!(Y, A, B) -> Y + A_mul_B!(Y, A, B) -> Y -Calculates the matrix-matrix or matrix-vector product *A B* and stores the -result in *Y*, overwriting the existing value of *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); +```jldoctest +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 ``` """ A_mul_B! @@ -7159,46 +7135,39 @@ Compute the inverse hyperbolic tangent of `x` atanh doc""" -```rst -.. deleteat!(collection, index) + deleteat!(collection, index) -Remove the item at the given ``index`` and return the modified ``collection``. +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 - +```jldoctest +julia> deleteat!([6, 5, 4, 3, 2, 1], 2) +5-element Array{Int64,1}: + 6 + 4 + 3 + 2 + 1 ``` """ deleteat!(collection, index::Integer) doc""" -```rst -.. deleteat!(collection, itr) - -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. + deleteat!(collection, itr) -.. doctest:: - - julia> deleteat!([6, 5, 4, 3, 2, 1], 1:2:5) - 3-element Array{Int64,1}: - 5 - 3 - 1 +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:: +```jldoctest +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], (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 ``` """ deleteat!(collection, itr) @@ -7253,32 +7222,30 @@ Determine whether an object - such as a stream, timer, or mmap -- is not yet clo isopen doc""" -```rst -.. shift!(collection) -> item - -Remove the first ``item`` from ``collection``. + shift!(collection) -> item -.. doctest:: +Remove the first `item` from `collection`. - julia> A = [1, 2, 3, 4, 5, 6] - 6-element Array{Int64,1}: - 1 - 2 - 3 - 4 - 5 - 6 +```jldoctest +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 ``` """ shift! @@ -7856,20 +7823,16 @@ The highest value representable by the given (real) numeric `DataType`. typemax doc""" -```rst -.. all(itr) -> Bool + all(itr) -> Bool -Test whether all elements of a boolean collection are ``true``. -``` +Test whether all elements of a boolean collection are `true`. """ all(itr) doc""" -```rst -.. all(A, dims) + all(A, dims) -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`. """ all(A::AbstractArray, dims) @@ -9084,11 +9047,9 @@ Read `io` until the end of the stream/file and count the number of lines. To spe countlines doc""" -```rst -.. *(A, B) + *(A, B) Matrix multiplication -``` """ Base.(:(*))(::AbstractMatrix, ::AbstractMatrix) @@ -9124,12 +9085,10 @@ Base.(:(\))(x::Number,y::Number) doc""" -```rst -.. *(x, y...) + *(x, y...) -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, ...)`. """ Base.(:(*))(x, y...) @@ -11765,11 +11724,10 @@ On Windows, split a path into the drive letter part and the path part. On Unix s splitdrive doc""" -```rst -.. pop!(collection, key[, default]) + pop!(collection, key[, default]) -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. """ pop!(collection,key,?) diff --git a/doc/stdlib/collections.rst b/doc/stdlib/collections.rst index e799270b79ce2..118d6da0ac328 100644 --- a/doc/stdlib/collections.rst +++ b/doc/stdlib/collections.rst @@ -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) @@ -1059,46 +1059,46 @@ Dequeues .. 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) @@ -1121,146 +1121,131 @@ Dequeues .. 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 - - .. 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], (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 = [6, 5, 4, 3, 2, 1]; splice!(A, 5) + 2 - 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, 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, 1, [-1, -2, -3]) - 6 + 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. @@ -1296,15 +1281,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/math.rst b/doc/stdlib/math.rst index 36281009fc948..c1eec1b0ae6d5 100644 --- a/doc/stdlib/math.rst +++ b/doc/stdlib/math.rst @@ -426,17 +426,16 @@ Mathematical Operators .. Docstring generated from Julia source - Calculates the matrix-matrix or matrix-vector product *A B* and stores the - result in *Y*, overwriting the existing value of *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(...) diff --git a/doc/stdlib/numbers.rst b/doc/stdlib/numbers.rst index 3fbcbe9f587e5..0172faa50d574 100644 --- a/doc/stdlib/numbers.rst +++ b/doc/stdlib/numbers.rst @@ -302,16 +302,15 @@ 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:: + .. code-block:: julia - 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. @@ -451,12 +450,12 @@ Integers .. 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 @@ -511,11 +510,11 @@ Integers .. doctest:: - julia> isodd(9) - true + julia> isodd(9) + true - julia> isodd(10) - false + julia> isodd(10) + false .. function:: iseven(x::Integer) -> Bool diff --git a/doc/stdlib/strings.rst b/doc/stdlib/strings.rst index 91434fba70395..d7338a03fa537 100644 --- a/doc/stdlib/strings.rst +++ b/doc/stdlib/strings.rst @@ -31,12 +31,12 @@ .. Docstring generated from Julia source - Repeat ``n`` times the string ``s``. The ``^`` operator is an alias to this function. + Repeat ``n`` times the string ``s``\ . The ``repeat`` function is an alias to this operator. .. doctest:: - julia> "Test "^3 - "Test Test Test " + julia> "Test "^3 + "Test Test Test " .. function:: string(xs...)