[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Avoid floating-point compares on Stem:head_positions; issue 4310 (is
From: |
Keith OHara |
Subject: |
Re: Avoid floating-point compares on Stem:head_positions; issue 4310 (issue 217720043 by address@hidden) |
Date: |
Wed, 11 Mar 2015 09:36:24 -0700 |
User-agent: |
Opera Mail/12.16 (Win32) |
On Wed, 11 Mar 2015 02:10:29 -0700, <address@hidden> wrote:
_How_ do we arrive at different versions of 3.0 here, or at GCC
considering 3.0 > 3.0 ?
Probably we get different numbers that are close to 3.00... or 2.99...
The head positions are individually multiplied by staff-space in
Grob::get_offset() and then divided by staff-space
Staff_symbol_referencer::internal_get_position() and at magstep=2 staff-space
is 2^(1/3)
I think a standard-conforming implementation should give bit-identical
floating-point results for these parallel computations, but suspect some
compiler option is set to allow non-conformance (retaining the most-recent
value in register with its guard bits intact for the comparison, maybe).
In general, I think it wisest for us to code in a way that allows floating
point to be inexact. The broader change that I considered was to count only
only [+inf -inf] as the 'empty' interval in is_empty() as we considered doing
before.
https://codereview.appspot.com/217720043/