www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Integer without restrictions

reply ... <qchessv2 gmail.com> writes:
How to create an integer without restrictions of size? Do I need 
to create a new class or there is a type of integer that doesn't 
have any restrictions in size?
Mar 15 2020
parent reply Paul Backus <snarwin gmail.com> writes:
On Sunday, 15 March 2020 at 19:02:00 UTC, ... wrote:
 How to create an integer without restrictions of size? Do I 
 need to create a new class or there is a type of integer that 
 doesn't have any restrictions in size?
http://dpldocs.info/experimental-docs/std.bigint.html
Mar 15 2020
parent reply ... <qchessv2 gmail.com> writes:
On Sunday, 15 March 2020 at 19:03:54 UTC, Paul Backus wrote:
 On Sunday, 15 March 2020 at 19:02:00 UTC, ... wrote:
 How to create an integer without restrictions of size? Do I 
 need to create a new class or there is a type of integer that 
 doesn't have any restrictions in size?
http://dpldocs.info/experimental-docs/std.bigint.html
And if I need to create very large value, how to use GMP library (It isn't described in that post)?
Mar 15 2020
parent Dennis <dkorpel gmail.com> writes:
On Sunday, 15 March 2020 at 19:07:05 UTC, ... wrote:
 And if I need to create very large value, how to use GMP 
 library (It isn't described in that post)?
You can use C bindings [1], look up examples in C and do the same in D, or use a high-level wrapper [2]. [1] https://code.dlang.org/packages/libgmp [2] https://code.dlang.org/packages/gmp-d
Mar 15 2020