A
A
annozzer2016-01-20 20:32:45
Programming
annozzer, 2016-01-20 20:32:45

How to make BigInteger?

We were asked to create a data type that would take values ​​greater than n^64 i.e. greater than long. I'm not asking you to do the task for me, just give me a hint what to do in general?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sanan Yuzb, 2016-01-20
@Sanan07

We need to create a class that will have methods for manipulating numbers with long arithmetic, i.e. sum, product, etc. Mostly done based on an array.

R
Rsa97, 2016-01-20
@Rsa97

You can represent a number as a string, or as a set of "numbers" in base, say 1'000'000'000, stored in an array. After choosing a representation, you need to write operations to work with it (addition, subtraction, division, multiplication, etc.), then arrange it all in a class with overloaded operations.

S
Stalker_RED, 2016-01-20
@Stalker_RED

Everything has already been stolen before us
https://msdn.microsoft.com/en-us/library/system.nu...
https://ru.wikipedia.org/wiki/%D0%94%D0%BB%D0% B8%D...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question