U
U
utyfua2016-01-15 17:35:04
C++ / C#
utyfua, 2016-01-15 17:35:04

C++: working with big numbers?

I need to use numbers with 10 characters in c++. I don't need the characters after the dot. I would use an array but I need to get the root of the 3rd degree. with int everything works for me but with large numbers there is a hitch ..

Answer the question

In order to leave comments, you need to log in

5 answer(s)
V
Vitaly, 2016-01-15
@utyfua

You don't have big numbers. Look here for the type you need: en.cppreference.com/w/cpp/language/types
If not, then libraries like gmp.

O
Oleg Tsilyurik, 2016-01-15
@Olej

I need to use numbers with 10 characters in c++. I don't need the characters after the dot. I would use an array but I need to get the root of the 3rd degree. everything works with int

But it seems to me that you have a complete mess in your head ... and no brief advice here will help:
- the root (at least "from the 3rd degree", at least from any) - is not extracted
- you need real numbers, but you need symbols after a dot or not - it does not matter anymore
- in the new C ++ standards there is a real type long double, the precision of which is much higher than your required 10 digits.

M
maaGames, 2016-01-15
@maaGames

Use normal 64 bit integers (int64_t or similar names, depending on the compiler). 2^64 is 18 characters.

D
Dmitry Entelis, 2014-07-22
@pashulke

Parsed directly from the site.
ikea has the same design of all product pages, the product page itself can be opened by a direct link knowing the article www.ikea.com/ru/ru/catalog/products/60260698
Availability is again easily recognized by the article www.ikea.com/ru/ru/ catalog/stockcheck
If you look at the layout, they don't even cache pictures, they give you a direct link to ikea.
Or do you have the essence of the question - how exactly is such parsing done?
For example, pages are downloaded through curl, and the necessary content is torn out with regular expressions.

K
Kirill Zakharov, 2014-07-22
@yTko

GET www.ikea.com/ru/ru/iows/catalog/availability/:id will return base64 xml with product availability and quantity in a particular store

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question