In [3]:
?mult2
Out[3]:
In [2]:
" mult2(x) multiplies x by 2 "
function mult2(x)
2*x
end
Out[2]:
In [8]:
"""
mult2(x)
Multiply x by 2.
"""
function mult2(x)
2*x
end
Out[8]:
In [9]:
?mult2
Out[9]:
In [10]:
"""
mult2(x)
Multiply x by 2.
- simple
- easy
- useless
"""
function mult2(x)
2*x
end
Out[10]:
In [11]:
?mult2
Out[11]:
In [21]:
"""
mult2(x)
Multiply `x` by 2 yielding ``y = 2x``.
"""
function mult2(x)
2*x
end
Out[21]:
In [22]:
?mult2
Out[22]:
In [12]:
"""
mult2(x)
Multiply x by 2.
# Arguments
- `x` : Number to be multiplied
"""
function mult2(x)
2*x
end
Out[12]:
In [13]:
?mult2
Out[13]:
In [16]:
"""
mult2(x::Integer)
Multiply integer x by 2.
"""
function mult2(x::Integer)
2*x
end
Out[16]:
In [17]:
?mult2
Out[17]:
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
Out[20]:
In [21]:
?mult2
Out[21]:
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.
julia> newonInv(2)
0.5
In [ ]: