diff --git a/CHANGES.md b/CHANGES.md index 393839281..c3bf4b5aa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## Version 0.7.3-DEV (released 2021-XYZ) +- Remove `Base.big(obj::GapObj)`: nothing was using it and it does not really + fit conceptually into this package. + + ## Version 0.7.2 (released 2021-11-17) - Use a `GAP_pkg_juliainterface_jll` to installed a compiled version of the diff --git a/docs/src/conversion.md b/docs/src/conversion.md index 2575e1b8c..1f02dbff4 100644 --- a/docs/src/conversion.md +++ b/docs/src/conversion.md @@ -59,7 +59,6 @@ Int128 BigInt Rational Float64 -big Char Cuchar String diff --git a/src/constructors.jl b/src/constructors.jl index 98c119935..d467dafb0 100644 --- a/src/constructors.jl +++ b/src/constructors.jl @@ -79,45 +79,6 @@ julia> Int128(val) """ Int128 -""" - big(obj::GapObj) - -Return the big integer converted from -the [GAP integer](GAP_ref(ref:Integers)) `obj`, -or the big rational converted from -the [GAP rational](GAP_ref(ref:Rationals)) `obj`, -or the big float converted from -the [GAP float](GAP_ref(ref:Floats)) `obj`. - -# Examples -```jldoctest -julia> val = GAP.evalstr("2^64") -GAP: 18446744073709551616 - -julia> big(val) -18446744073709551616 - -julia> val = GAP.evalstr("1/3") -GAP: 1/3 - -julia> big(val) -1//3 - -julia> val = GAP.evalstr("1.1") -GAP: 1.1 - -julia> big(val) -1.100000000000000088817841970012523233890533447265625 - -``` -""" -function Base.big(obj::GapObj) - GAP_IS_INT(obj) && return BigInt(obj) - GAP_IS_RAT(obj) && return Rational{BigInt}(obj) - GAP_IS_MACFLOAT(obj) && return BigFloat(obj) - throw(ConversionError(obj, "a type supported by big")) -end - ## Rationals """ Rational{T}(obj::GapObj) where {T<:Integer} diff --git a/test/constructors.jl b/test/constructors.jl index 8da91cafa..39767f8f7 100644 --- a/test/constructors.jl +++ b/test/constructors.jl @@ -46,17 +46,6 @@ @test_throws GAP.ConversionError Float64(x) end - @testset "big (is not a constructor but fits here)" begin - x = GAP.evalstr("2^100") - @test big(x) == BigInt(2)^100 - x = GAP.evalstr("2^100/3") - @test big(x) == BigInt(2)^100 // 3 - x = GAP.evalstr("2.") - @test big(x) == BigFloat(2.0) - x = GAP.evalstr("[]") - @test_throws GAP.ConversionError big(x) - end - @testset "Chars" begin x = GAP.evalstr("'x'") @test Cuchar(x) == Cuchar('x')