3 ms·
There are older languages just waiting for the people who dislike IEEE 754 floats to notice them too, like Common Lisp and Scheme. They have a numeric tower whi
by db48x 3y ago
There are older languages just waiting for the people who dislike IEEE 754 floats to notice them too, like Common Lisp and Scheme. They have a numeric tower which includes both rational and complex rational numbers:
> (+ 5/3 4/5)
37/15
> (expt #C(0 1) 2)
-1
> (expt #C(3/2 1/2) 2)
#C(2 3/2)
And of course they all support arbitrary precision numbers as well:
> (complex (fact 10) (fact 20))
#C(3628800 2432902008176640000)
> (/ (complex (fact 10) (fact 20)) 29)
#C(3628800/29 2432902008176640000/29)
Composition is a wonderful thing.