Hacker News new | ask | show | jobs
by ordu 3284 days ago
The most of programming languages suck even with integer numbers, their integers is more like ring of integers modulo 2^n.[1] Its not true for every programming language, but for languages like C, C++ it is. To implement math integers one will need to allow that integers to grow in size and to be more like strings. But such a engineering decision will hurt speed of program and raise memory usage. Though some languages do it. Common Lisp, for example, uses arbitrary precision numbers, and so you can get very big numbers while calculating without any special efforts like using external library for arbitraty precision numbers, GMP for instance.[2]

Computer numbers is not math numbers, and its better to always remember this fact.

[1] https://en.wikipedia.org/wiki/Multiplicative_group_of_intege...

[2] https://gmplib.org/