-3

I have a task to work with extra large numbers on our scientific project. Numbers are between 150 and 200 digits. How can I accomplish this only using the standard template library? I am ok on lower values using long double.

I read somewhere that I should put my numbers in

Cœur
  • 37,241
  • 25
  • 195
  • 267
Larry Mack
  • 21
  • 1
  • 3
    why would you want to avoid proven implementations which do what you neeed? – m.s. Jun 21 '15 at 14:19
  • One can only assume OP doesn't have a choice. In that case, the only real option is to reimplement the necessary classes. I would work on convincing whoever is preventing me from using libraries to be smarter. – Ron Thompson Jun 21 '15 at 14:58
  • Do you want a toy, or something with real world performance? – n. m. could be an AI Jun 21 '15 at 15:04
  • @Ron: One has several other options than "assume OP doesn't have a choice". e.g. assuming this is an XY problem (with Y being "avoid using STL") until the OP clarifies otherwise. –  Jun 21 '15 at 15:34

1 Answers1

2

I'm assuming from your question that you need to work with the exact value of large integers.

Alas, the C++ standard library does not feature multiprecision arithmetic. (nor does the ancient standard template library)

From what little information you've given, your only reasonable option is to use an external library. It is almost certainly far more worth your effort to make that work than to try and write your own library.