-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
bignumsBigInt and BigFloatBigInt and BigFloat
Description
- The output of
versioninfo()
Julia Version 1.8.4
Commit 00177ebc4fc (2022-12-23 21:32 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 × AMD Ryzen 7 5800U with Radeon Graphics
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, znver3)
Threads: 1 on 16 virtual cores
-
How you installed Julia
See https://aur.archlinux.org/packages/julia-bin -
A minimal working example (MWE), also known as a minimum reproducible example
julia> binomial(big(1), big(typemax(UInt64))+1)
ERROR: InexactError: UInt64(18446744073709551616)
Stacktrace:
[1] Type
@ ./gmp.jl:354 [inlined]
[2] binomial(n::BigInt, k::BigInt)
@ Base.GMP ./gmp.jl:685
[3] top-level scope
@ REPL[3]:1
Culprit base/gmp.jl:685:
binomial(n::BigInt, k::Integer) = k < 0 ? BigInt(0) : binomial(n, UInt(k))
This is probably a limitation due to GMP, but in that case
- Probably
binomial(n::BigInt, k::Integer) = k < 0 ? BigInt(0) : binomial(n, UInt(min(k, n-k)))will cover more cases, - Limitations are not currently documented.
Please advise on how to proceed — if at all — thanks!
Metadata
Metadata
Assignees
Labels
bignumsBigInt and BigFloatBigInt and BigFloat