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.



> > 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?
>
> > 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?
>
> Do Float constants like EPSILON, MIN, and MAX differ between x87 systems
> and modern FPUs?
>
> Does "x87" == "non-IEEE-754" and "modern FPU" == "IEEE-754"?
>
> I find this topic fascinating and am just trying to understand the subtle
> semantics involved here!
>
> Thanks,
> Dave
>
>
>

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