Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Sep 27, 2013
1 parent 182331a commit 721c9fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/gmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (~), (&), (|), ($),
binomial, cmp, convert, div, divrem, factorial, fld, gcd, gcdx, lcm, mod,
ndigits, promote_rule, rem, show, isqrt, string, isprime, powermod,
widemul, sum, trailing_zeros, trailing_ones, count_ones, base, parseint,
serialize, deserialize, bin, oct, dec, hex
serialize, deserialize, bin, oct, dec, hex, isequal

type BigInt <: Integer
alloc::Cint
Expand Down Expand Up @@ -353,6 +353,7 @@ end
binomial(n::BigInt, k::Integer) = k<0 ? throw(DomainError()) : binomial(n, uint(k))

==(x::BigInt, y::BigInt) = cmp(x,y) == 0
isequal(x::BigInt, y::BigInt) = cmp(x,y) == 0
<=(x::BigInt, y::BigInt) = cmp(x,y) <= 0
>=(x::BigInt, y::BigInt) = cmp(x,y) >= 0
<(x::BigInt, y::BigInt) = cmp(x,y) < 0
Expand Down
1 change: 1 addition & 0 deletions test/bigint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ b = BigInt("123456789012345678901234567891")

@test typeof(a+1) == BigInt
@test a+1 == b
@test isequal(a+1, b)
@test b == a+1
@test !(b == a)
@test b > a
Expand Down

0 comments on commit 721c9fb

Please sign in to comment.