diff --git a/base/intfuncs.jl b/base/intfuncs.jl index 6e8def9e5c308..ec57f7f80d809 100644 --- a/base/intfuncs.jl +++ b/base/intfuncs.jl @@ -13,25 +13,25 @@ The arguments may be integer and rational numbers. # Examples ```jldoctest -julia> gcd(6,9) +julia> gcd(6, 9) 3 -julia> gcd(6,-9) +julia> gcd(6, -9) 3 -julia> gcd(6,0) +julia> gcd(6, 0) 6 -julia> gcd(0,0) +julia> gcd(0, 0) 0 -julia> gcd(1//3,2//3) +julia> gcd(1//3, 2//3) 1//3 -julia> gcd(1//3,-2//3) +julia> gcd(1//3, -2//3) 1//3 -julia> gcd(1//3,2) +julia> gcd(1//3, 2) 1//3 julia> gcd(0, 0, 10, 15) @@ -90,33 +90,33 @@ The arguments may be integer and rational numbers. # Examples ```jldoctest -julia> lcm(2,3) +julia> lcm(2, 3) 6 -julia> lcm(-2,3) +julia> lcm(-2, 3) 6 -julia> lcm(0,3) +julia> lcm(0, 3) 0 -julia> lcm(0,0) +julia> lcm(0, 0) 0 -julia> lcm(1//3,2//3) +julia> lcm(1//3, 2//3) 2//3 -julia> lcm(1//3,-2//3) +julia> lcm(1//3, -2//3) 2//3 -julia> lcm(1//3,2) +julia> lcm(1//3, 2) 2//1 -julia> lcm(1,3,5,7) +julia> lcm(1, 3, 5, 7) 105 ``` """ function lcm(a::T, b::T) where T<:Integer - # explicit a==0 test is to handle case of lcm(0,0) correctly + # explicit a==0 test is to handle case of lcm(0, 0) correctly # explicit b==0 test is to handle case of lcm(typemin(T),0) correctly if a == 0 || b == 0 return zero(a) @@ -214,13 +214,13 @@ and ``div(y,m) = 0``. This will throw an error if ``m = 0``, or if # Examples ```jldoctest -julia> invmod(2,5) +julia> invmod(2, 5) 3 -julia> invmod(2,3) +julia> invmod(2, 3) 2 -julia> invmod(5,6) +julia> invmod(5, 6) 5 ``` """ @@ -894,14 +894,14 @@ the array length. If the array length is excessive, the excess portion is filled # Examples ```jldoctest -julia> digits!([2,2,2,2], 10, base = 2) +julia> digits!([2, 2, 2, 2], 10, base = 2) 4-element Vector{Int64}: 0 1 0 1 -julia> digits!([2,2,2,2,2,2], 10, base = 2) +julia> digits!([2, 2, 2, 2, 2, 2], 10, base = 2) 6-element Vector{Int64}: 0 1