Skip to content

Commit

Permalink
references for BigFloat
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 28, 2017
1 parent f71acca commit 9ce4465
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
14 changes: 8 additions & 6 deletions base/mpfr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ end
Create an arbitrary precision floating point number. `x` may be an [`Integer`](@ref), a
[`Float64`](@ref) or a [`BigInt`](@ref). The usual mathematical operators are defined for
this type, and results are promoted to a `BigFloat`.
this type, and results are promoted to a [`BigFloat`](@ref).
Note that because decimal literals are converted to floating point numbers when parsed,
`BigFloat(2.1)` may not yield what you expect. You may instead prefer to initialize
Expand Down Expand Up @@ -133,7 +133,7 @@ float(::Type{BigInt}) = BigFloat
"""
BigFloat(x, prec::Int)
Create a representation of `x` as a `BigFloat` with precision `prec`.
Create a representation of `x` as a [`BigFloat`](@ref) with precision `prec`.
"""
function BigFloat(x, prec::Int)
setprecision(BigFloat, prec) do
Expand All @@ -144,7 +144,8 @@ end
"""
BigFloat(x, prec::Int, rounding::RoundingMode)
Create a representation of `x` as a `BigFloat` with precision `prec` and rounding mode `rounding`.
Create a representation of `x` as a [`BigFloat`](@ref) with precision `prec` and
rounding mode `rounding`.
"""
function BigFloat(x, prec::Int, rounding::RoundingMode)
setrounding(BigFloat, rounding) do
Expand All @@ -155,7 +156,8 @@ end
"""
BigFloat(x, rounding::RoundingMode)
Create a representation of `x` as a `BigFloat` with the current global precision and rounding mode `rounding`.
Create a representation of `x` as a [`BigFloat`](@ref) with the current global precision
and rounding mode `rounding`.
"""
function BigFloat(x::Union{Integer, AbstractFloat, String}, rounding::RoundingMode)
BigFloat(x, precision(BigFloat), rounding)
Expand All @@ -164,7 +166,7 @@ end
"""
BigFloat(x::String)
Create a representation of the string `x` as a `BigFloat`.
Create a representation of the string `x` as a [`BigFloat`](@ref).
"""
BigFloat(x::String) = parse(BigFloat, x)

Expand Down Expand Up @@ -728,7 +730,7 @@ end
"""
precision(BigFloat)
Get the precision (in bits) currently used for `BigFloat` arithmetic.
Get the precision (in bits) currently used for [`BigFloat`](@ref) arithmetic.
"""
precision(::Type{BigFloat}) = DEFAULT_PRECISION[end] # precision of the type BigFloat itself

Expand Down
2 changes: 1 addition & 1 deletion base/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Currently supported rounding modes are:
- [`RoundNearestTiesAway`](@ref)
- [`RoundNearestTiesUp`](@ref)
- [`RoundToZero`](@ref)
- `RoundFromZero` (`BigFloat` only)
- `RoundFromZero` ([`BigFloat`](@ref) only)
- [`RoundUp`](@ref)
- [`RoundDown`](@ref)
"""
Expand Down
3 changes: 2 additions & 1 deletion doc/src/stdlib/numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ Base.iseven

## BigFloats

The `BigFloat` type implements arbitrary-precision floating-point arithmetic using the [GNU MPFR library](http://www.mpfr.org/).
The [`BigFloat`](@ref) type implements arbitrary-precision floating-point arithmetic using
the [GNU MPFR library](http://www.mpfr.org/).

```@docs
Base.precision
Expand Down

0 comments on commit 9ce4465

Please sign in to comment.