File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -931,7 +931,7 @@ function Base.://(x::Rational{BigInt}, y::Rational{BigInt})
931931 if iszero (x. num)
932932 throw (DivideError ())
933933 end
934- return (isneg (x. num) ? - one (BigFloat ) : one (BigFloat )) // y. num
934+ return (isneg (x. num) ? - one (BigInt ) : one (BigInt )) // y. num
935935 end
936936 zq = _MPQ ()
937937 ccall ((:__gmpq_div , :libgmp ), Cvoid,
Original file line number Diff line number Diff line change @@ -69,6 +69,18 @@ ee = typemax(Int64)
6969 @test big (typeof (complex (x, x))) == typeof (big (complex (x, x)))
7070 end
7171 end
72+ @testset " division" begin
73+ oz = big (1 // 0 )
74+ zo = big (0 // 1 )
75+
76+ @test_throws DivideError () oz / oz
77+ @test oz == oz / one (oz)
78+ @test - oz == oz / (- one (oz))
79+ @test zero (oz) == one (oz) / oz
80+ @test_throws DivideError () zo / zo
81+ @test one (zo) / zo == big (1 // 0 )
82+ @test - one (zo) / zo == big (- 1 // 0 )
83+ end
7284end
7385@testset " div, fld, mod, rem" begin
7486 for i = - 10 : 10 , j = [- 10 : - 1 ; 1 : 10 ]
You can’t perform that action at this time.
0 commit comments