Some concepts have names, and sometimes we care about those names, even (or especially) in our code.
At other times, we only care to distinguish one thing from the other. There are times when there’s no inherently meaningful value for a thing. For example, if we’re storing products in a database table we probably don’t want to store their category as a string. We don’t care how the categories are named, and besides, marketing changes the names all the time.
We care only that they’re distinct from each other.
CategoryBooks = 0
CategoryHealth = 1
CategoryClothing = 2…
At times we would want to do mathematical operations which involves very big integer calculations that are outside the limit of all available primitive data types. For example factorial of 100 contains 158 digits in it so we can’t store it in any primitive data type available. Golang doesn’t check for overflows implicitly and so this may lead to unexpected results when a number larger than 64 bits are stored in a int64.
To solve this problem, Go provides the Package “big” which implements arbitrary-precision arithmetic (big numbers).
The following numeric types are supported:
Int signed integers