Re: Is it safe to assume floats always have a 53-bit mantissa?

2015-12-30 Thread Terry Reedy
On 12/30/2015 8:18 AM, Steven D'Aprano wrote: We know that Python floats are equivalent to C doubles, Yes which are 64-bit IEEE-754 floating point numbers. I believe that this was not true on all systems when Python was first released. Not all 64-bit floats divided them the same way. I b

Re: Is it safe to assume floats always have a 53-bit mantissa?

2015-12-30 Thread Marko Rauhamaa
Steven D'Aprano : > Nevertheless, it's well known (in the sense that "everybody knows") > that Python floats are equivalent to C 64-bit IEEE-754 doubles. How > safe is that assumption? You'd need to have it in writing, wouldn't you? The only spec I know of promises no such thing: Floating po

Is it safe to assume floats always have a 53-bit mantissa?

2015-12-30 Thread Steven D'Aprano
We know that Python floats are equivalent to C doubles, which are 64-bit IEEE-754 floating point numbers. Well, actually, C doubles are not strictly defined. The only promise the C standard makes is that double is no smaller than float. (That's C float, not Python float.) And of course, not all Py