News for hackers. Stuff that matters.
Re:What’s So Great about Continued Fractions? by bazzargh on Sunday March 22, 2015 @04:17PM (#9248057)
And there's the rabbithole again...I spent much of last week being fascinated by reading around "Exact Real Arithmetic With Continued Fractions" (https://hal.inria.fr/inria-00075792/document, PDF). More resources on this on the Haskell wiki: https://wiki.haskell.org/Exact_real_arithmetic

...which is a bit mindblowing when so much of what we do uses numbers with limited precision. How can irrational numbers be represented in finite space? Using representations like this: http://en.wikipedia.org/wiki/Periodic_continued_fraction

Re:What’s So Great about Continued Fractions? by grumpy-buffalo on Sunday March 22, 2015 @04:43PM (#9248142)
Careful -- because R is uncountable, there is no system for representing arbitrary irrational numbers with finite strings. All irrational numbers with periodic continued fractions are quadratic irrationals, i.e. they can be written as A + B sqrt(C) where A, B, C are all rational. And of course, that formula immediately provides a much more straightforward way to represent such irrational numbers by finite strings!
Re:What’s So Great about Continued Fractions? by bazzargh on Sunday March 22, 2015 @05:54PM (#9248407)
Yes, I avoided the word 'arbitrary'. The references make it clear that what they're dealing with is the computable reals - only a countably infinite subset of R. Other representations get used too (like streams of dyadic rationals), and the computable reals contain more than just quadratic roots - eg: pi - but the computable reals are all you get, and this means there's some rough edges - http://en.wikipedia.org/wiki/Specker_sequence.

Still fascinating though.

Re:What’s So Great about Continued Fractions? by mvr_ on Sunday March 22, 2015 @10:08PM (#9249138)
If you are interested, I have been playing with some of these ideas here: https://github.com/mvr/cf