4 ms·
It's surprising that none of the popular high level languages that borrow so much else from Lisp haven't borrowed its rational number type. Really the whole num
by User23 4y ago
It's surprising that none of the popular high level languages that borrow so much else from Lisp haven't borrowed its rational number type. Really the whole numeric tower makes a ton of sense, and you can always declare floats if needed.
- mdouglass 4y agoThanks for the encouragement to look up lisp's numeric tower (https://en.wikipedia.org/wiki/Numerical_tower https://en.wikipedia.org/wiki/Numerical_tower), that was interesting to compare to the languages I'm more familiar with.
- kazinator 4y agoIncluding Lisp. Not every Lisp dialect has rationals.
- cbolton 4y agoWhat about Julia? It's somewhat popular and heavily inspired by Lisp. It has a type tree that's reminiscent of Lisp's numerical tower: https://global.discourse-cdn.com/business5/uploads/julialang/original/2X/4/4612397a30b75f0c3d7c48072f142d01d2309fc9.png https://global.discourse-cdn.com/business5/uploads/julialang...
- yawaramin 4y agoRationals are not really great for a long series of calculations. E.g. imagine taking the average of a bunch of numbers like 1.15542345089. It will blow up your CPU usage to stratospheric levels.