I wrongly sent previous mail.

2013年4月22日月曜日 David MacMahon davidm / astro.berkeley.edu:

>
> On Apr 21, 2013, at 7:18 PM, naruse (Yui NARUSE) wrote:
>
> > marcandre (Marc-Andre Lafortune) wrote:
> >> For any float f, the two following conditions should hold:
> >> (1) f.to_s.to_f == f        (round trips)
> >
> > Yeah, unless you transfer the result of to_s to another environment.
>
> Are you saying that round tripping is only valid on "the native
> architecture's double-precision floating point representation" (quote from
> Float's RDoc)?  That would make sense to me.


Yes, only portable on the same architecture.


> > x87 FPU stores and calculates floating numbers in 80bit on registers,
> even if it is stored in 64bit on memory.
>
> Does Float on x87 systems use 80-bits to store its value?  IOW, is "the
> native architecture's double-precision floating point representation" 80
> bits on x87?Asking (almost) the same thing a third way, what is
> "sizeof(double)" on a system with an x87 FPU?
>

x87 stores value 80bit on registers and arithmetics, 64bit on memory.
So sizeof(double)=8.


> > Therefore x87's result may differ from modern FPU's result.
>
> I agree that the results of floating point operations on x87 may differ
> from the same operations on modern FPU's given the same input operands due
> to 80-bit intermediate values on x87, but does this affect the parsing of
> Float literals?


Parsing itself is of course doesn't affect.
Decimal-binary conversion affect it


> Do Float constants like EPSILON, MIN, and MAX differ between x87 systems
> and modern FPUs?


I'll show those constants on my 32bit Linux.


> Does "x87" == "non-IEEE-754" and "modern FPU" == "IEEE-754"?
>

I think what you think is correct.
Why I didn't write so is because as far as I understand, x87 complies IEEE
754 standard; the standard allows to store and calculate float64 in 80bit.


-- 
NARUSE, Yui  <naruse / airemix.jp>