Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: i386 floating point expertise needed

    Date:        Thu, 30 Nov 2017 06:40:24 -0500 (EST)
    From:        Mouse <mouse%Rodents-Montreal.ORG@localhost>
    Message-ID:  <201711301140.GAA22191%Stone.Rodents-Montreal.ORG@localhost>

  | Unfortunately (for you)....

Actually, it isn't.

  |        [#2] The values of floating operands and of the  results  of
  |        floating expressions may be represented in greater precision
  |        and range than that required by the type; the types are  not
  |        changed thereby.

This would suggest that the original change, not comparing for
equality, but just for pretty damn close, is the right thing to
do, as the result of strtod() is a floating expression, and so
would not need to be the precisely the same as the stored variable.


  | [with a footnote]
  |        52)The  cast  and assignment operators are still required to
  |           perform  their  specified  conversions  as  described  in
  |  and

This suggests (without seeing those sections, so guessing a bit)
that perhaps just sticking a (seemingly meaningless) "(double)" cast
on the value returned might force it to be reduced from 80 bits to 64
(the same as -ffloat-store, if I am guessing correctly as to what that
accomplishes) but only for the one expression where it matters.

That would be another possible solution, I will test that one, and
see if it works.


Home | Main Index | Thread Index | Old Index