3 ms·
I think Factor has the best number implementation. It has builtin support for bignums and rationals. Eg: IN: scratchpad 2 63 ^ 1 + 2 63 ^ / 2 63 ^ * 2 63
by bjourne 7y ago
I think Factor has the best number implementation. It has builtin support for bignums and rationals. Eg:
IN: scratchpad 2 63 ^ 1 + 2 63 ^ / 2 63 ^ * 2 63 ^ 1 + =
t
The corresponding expression would incorrectly evaluate to false in most languages:
>>> n = 63
>>> (2**n + 1) / 2**n * 2**n == 2**n + 1
False
Factor also has syntactic support for complex numbers but not for irrational ones.