Question: what is the difference between double and long integer?
Answer: Double can store numbers larger than 16 digits, but at the cost of truncation/rounding in the low-order digits. If you need more than 19 digits precision you must resort to BigInteger , with the expected decrease in performance. The long data type is a 64-bit signed two's complement integer.