Re: i386 floating point expertise needed

Robert Elz <[email protected]>
Newsgroups gmane.os.netbsd.ports.i386
Message-ID <[email protected]>
    Date:        Thu, 30 Nov 2017 06:40:24 -0500 (EST)
    From:        Mouse <[email protected]>
    Message-ID:  <[email protected]>

  | Unfortunately (for you)....

Actually, it isn't.

  | 6.3.1.8
  | 
  |        [#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.

Or:

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

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.

kre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.