It really depends on what you are trying to achieve with your code.
If you are later on going to use the value as a size_t
(in other words, for sizing a vector, allocating memory, or some such), then you probably should do some checks that it's not overflowing, but store the value as a size_t
. You won't be able to use a bigger type anyway, if the purpose is to create a new object based on the size.
If you are doing something like "calculating the number of possible combinations from these X vectors", then using a floating point type will probably be "good enough".