3 ms·
Ceylon: True advance, or just another language?
- ggchappell 15y agoThis is interesting (under "Ceylon types"): > Decimal. Arbitrary precision and arbitrary scale decimals And then nothing more is said about them. But they raise all kinds of interesting issues. Obviously someone has thought about them; e.g., the name "Decimal" (as opposed to "Real") says you can't store, say, 1/3 exactly, let alone something like sqrt(2) or pi. But apparently 10^k, for just about any integral k, will produce an exact result. Not so for 2^k, though (rather un-computerish, no)? I'd like to find out more about these. Does anyone have any links or info? P.S. What would be really fun is some kind of lazily-evaluated arbitrary-precision value. Only compute as many digits as are needed at the moment. Can we also toss in a representation that could specify any rational exactly?
- chalst 15y agoI haven't seen anything more explicit than the Introduction to Ceylon blog posts, where Gavin does mention that only the natural and float types are built-in. It's not actually clear to me that the Decimal type is base-10. The word decimal is fairly often (mis)used to mean number representations with a decimal point.
- pavpanchekha 15y agoOn the topic of your postscript, check out continued fractions: they provide exactly lazily-computed arbitrary-precision values that can represent any rational exactly.