Documentation

Single Line


In [3]:
?mult2


search: accumulate accumulate! A_mul_Bt! A_mul_Bt At_mul_Bt! At_mul_Bt

Out[3]:

mult2(x) multiplies x by 2


In [2]:
" mult2(x) multiplies x by 2 "
function mult2(x)
    2*x
end


Out[2]:
mult2

Multi Line


In [8]:
"""
    mult2(x)

Multiply x by 2.
"""
function mult2(x)
    2*x
end


WARNING: replacing docs for 'mult2 :: Tuple{Any}' in module 'Main'.
Out[8]:
mult2

In [9]:
?mult2


search: accumulate accumulate! A_mul_Bt! A_mul_Bt At_mul_Bt! At_mul_Bt

Out[9]:
mult2(x)

Multiply x by 2.

Markdown Code


In [10]:
"""
    mult2(x)

Multiply x by 2.

- simple
- easy
- useless
"""
function mult2(x)
    2*x
end


WARNING: replacing docs for 'mult2 :: Tuple{Any}' in module 'Main'.
Out[10]:
mult2

In [11]:
?mult2


search: accumulate accumulate! A_mul_Bt! A_mul_Bt At_mul_Bt! At_mul_Bt

Out[11]:
mult2(x)

Multiply x by 2.

  • simple
  • easy
  • useless

Latex Code


In [21]:
"""
    mult2(x)

Multiply `x` by 2 yielding ``y = 2x``.
"""
function mult2(x)
    2*x
end


WARNING: replacing docs for 'mult2 :: Tuple{Any}' in module 'Main'.
Out[21]:
mult2

In [22]:
?mult2


search: accumulate accumulate! A_mul_Bt! A_mul_Bt At_mul_Bt! At_mul_Bt

Out[22]:
mult2(x)

Multiply x by 2 yielding $y = 2x$.

Argument List


In [12]:
"""
    mult2(x)

Multiply x by 2.

# Arguments
- `x` : Number to be multiplied
"""
function mult2(x)
    2*x
end


WARNING: replacing docs for 'mult2 :: Tuple{Any}' in module 'Main'.
Out[12]:
mult2

In [13]:
?mult2


search: accumulate accumulate! A_mul_Bt! A_mul_Bt At_mul_Bt! At_mul_Bt

Out[13]:
mult2(x)

Multiply x by 2.

Arguments

  • x : Number to be multiplied

Split Documentation


In [16]:
"""
    mult2(x::Integer)

Multiply integer x by 2.
"""
function mult2(x::Integer)
    2*x
end


WARNING: replacing docs for 'mult2 :: Tuple{Integer}' in module 'Main'.
Out[16]:
mult2

In [17]:
?mult2


search: accumulate accumulate! A_mul_Bt! A_mul_Bt At_mul_Bt! At_mul_Bt

Out[17]:
mult2(x)

Multiply x by 2.

Arguments

  • x : Number to be multiplied
mult2(x::Integer)

Multiply integer x by 2.

Examples Section


In [20]:
"""
    mult2(x::Integer)

Multiply integer x by 2.

# Examples
## Main Example
```
julia> mult2(1)
2
```
## Auxilliary Example
```
julia> mult2(2)
4
```
"""
function mult2(x::Integer)
    2*x
end


WARNING: replacing docs for 'mult2 :: Tuple{Integer}' in module 'Main'.
Out[20]:
mult2

In [21]:
?mult2


search: accumulate accumulate! A_mul_Bt! A_mul_Bt At_mul_Bt! At_mul_Bt

Out[21]:
mult2(x)

Multiply x by 2.

Arguments

  • x : Number to be multiplied
mult2(x::Integer)

Multiply integer x by 2.

Examples

Main Example

julia> mult2(1)
2

Auxilliary Example

julia> mult2(2)
4

Exercises

Task 1

Add a documentation to the function newtonInv from session 4, such that ?newtonInv displays the following information:

newtonInv(x::Real,y0=0.1;iterations=10)

Calculate an approximation of the inverse of x by using the iteration $y_{k+1} = 2*y_k - y_k^2*x$ with inital value $y_0$ = y0.

Examples

Main Example

julia> newonInv(2)
0.5

In [ ]: