I have a project for my school, and the goal of it is create simple "Virtual Machine" who execute operations.
To do that, we can store some numbers with types, they are: int8, int16, int32, float, double, and big decimal.
The only type i don't know is the "big decimal", it is describe with: "The maximum of digits to display after the decimal point is are float(7), double(15), bigdecimal(200)."
So big decimal type can have 200 digits after the decimal point.
Any type in C++ ca do that? If i have to deal with strings it's more complex for the operations...
Thanks you in advance !
PS: "• all (external) libraries, except the STL are explicity forbidden"
There is no "big-decimal" type in C++; from your description of the problem, it seems you are subposed to implement your own type with very-high precision.
There is more than one way to do this. Here are some hints/potential directions:
std::vector
. Of course, what exactly you want to put in that vector is a different question.