From 2059ed3b79af012486eddfd52057b7a59bf7f132 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Sat, 18 Aug 2018 21:30:41 +0200 Subject: [PATCH] Misc doc improvements (#28719) * doc: remove unused file. * doc: improve docstring of at-big_str * doc: fix some broken links (cherry picked from commit dbcc152fcdf03be537032a045117e8c8caf08b51) --- base/int.jl | 15 ++++++++++++--- doc/src/base/numbers.md | 16 +++++++++------- doc/src/manual/index.md | 39 --------------------------------------- 3 files changed, 21 insertions(+), 49 deletions(-) delete mode 100644 doc/src/manual/index.md diff --git a/base/int.jl b/base/int.jl index e6610e9af47740..718542e0e13ea7 100644 --- a/base/int.jl +++ b/base/int.jl @@ -579,9 +579,18 @@ end @big_str str @big_str(str) -`@big_str` parses a string into a BigInt -Throws an `ArgumentError` if the string is not a valid integer -Removes all underscores `_` from the string +Parse a string into a [`BigInt`](@ref) or [`BigFloat`](@ref), +and throw an `ArgumentError` if the string is not a valid number. +For integers `_` is allowed in the string as a separator. + +# Examples +```jldoctest +julia> big"123_456" +123456 + +julia> big"7891.5" +7.8915e+03 +``` """ macro big_str(s) if '_' in s diff --git a/doc/src/base/numbers.md b/doc/src/base/numbers.md index 190584bb0f8f46..50e6d2b7134da6 100644 --- a/doc/src/base/numbers.md +++ b/doc/src/base/numbers.md @@ -89,8 +89,6 @@ Base.isinteger Base.isreal Core.Float32(::Any) Core.Float64(::Any) -Base.GMP.BigInt(::Any) -Base.MPFR.BigFloat(::Any) Base.Rounding.rounding Base.Rounding.setrounding(::Type, ::Any) Base.Rounding.setrounding(::Function, ::Type, ::RoundingMode) @@ -113,18 +111,22 @@ Base.@int128_str Base.@uint128_str ``` -## BigFloats +## BigFloats and BigInts -The [`BigFloat`](@ref) type implements arbitrary-precision floating-point arithmetic using -the [GNU MPFR library](http://www.mpfr.org/). +The [`BigFloat`](@ref) and [`BigInt`](@ref) types implements +arbitrary-precision floating point and integer arithmetic, respectively. For +[`BigFloat`](@ref) the [GNU MPFR library](http://www.mpfr.org/) is used, +and for [`BigInt`](@ref) the [GNU Multiple Precision Arithmetic Library (GMP)] +(https://gmplib.org) is used. ```@docs +Base.MPFR.BigFloat(::Any) Base.precision Base.MPFR.precision(::Type{BigFloat}) Base.MPFR.setprecision Base.MPFR.BigFloat(x, prec::Int) -BigFloat(x::Union{Integer, AbstractFloat, String}, rounding::RoundingMode) +Base.MPFR.BigFloat(x::Union{Integer, AbstractFloat, String}, rounding::RoundingMode) Base.MPFR.BigFloat(x, prec::Int, rounding::RoundingMode) -Base.MPFR.BigFloat(x::String) +Base.GMP.BigInt(::Any) Base.@big_str ``` diff --git a/doc/src/manual/index.md b/doc/src/manual/index.md deleted file mode 100644 index 3ae00cff847e69..00000000000000 --- a/doc/src/manual/index.md +++ /dev/null @@ -1,39 +0,0 @@ -# The Julia Manual - - * [Introduction](@ref man-introduction) - * [Getting Started](@ref man-getting-started) - * [Variables](@ref) - * [Integers and Floating-Point Numbers](@ref) - * [Mathematical Operations and Elementary Functions](@ref) - * [Complex and Rational Numbers](@ref) - * [Strings](@ref) - * [Functions](@ref) - * [Control Flow](@ref) - * [Scope of Variables](@ref scope-of-variables) - * [Types](@ref man-types) - * [Methods](@ref) - * [Constructors](@ref man-constructors) - * [Conversion and Promotion](@ref conversion-and-promotion) - * [Interfaces](@ref) - * [Modules](@ref) - * [Documentation](@ref) - * [Metaprogramming](@ref) - * [Multi-dimensional Arrays](@ref man-multi-dim-arrays) - * [Missing Values](@ref missing) - * [Networking and Streams](@ref) - * [Parallel Computing](@ref) - * [Dates](@ref) - * [Running External Programs](@ref) - * [Calling C and Fortran Code](@ref) - * [Handling Operating System Variation](@ref) - * [Environment Variables](@ref) - * [Embedding Julia](@ref) - * [Profiling](@ref) - * [Memory allocation analysis](@ref) - * [Stack Traces](@ref) - * [Performance Tips](@ref man-performance-tips) - * [Workflow Tips](@ref man-workflow-tips) - * [Style Guide](@ref) - * [Frequently Asked Questions](@ref) - * [Noteworthy Differences from other Languages](@ref) - * [Unicode Input](@ref)