On Tuesday, March 4, 2014 8:32:01 AM UTC+5:30, Chris Angelico wrote: > On Tue, Mar 4, 2014 at 1:45 PM, Albert van der Horst wrote: > >>No, the Python built-in float type works with a subset of real numbers: > > To be more precise: a subset of the rational numbers, those with a > > denominator > > that is a power of two.
> And no more than N bits (53 in a 64-bit float) in the numerator, and > the denominator between the limits of the exponent. (Unless it's > subnormal. That adds another set of small numbers.) It's a pretty > tight set of restrictions, and yet good enough for so many purposes. > But it's a far cry from "all real numbers". Even allowing for > continued fractions adds only some more; I don't think you can > represent surds that way. See http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/cfINTRO.html#sqrts -- https://mail.python.org/mailman/listinfo/python-list