lilypond-devel
[Top][All Lists]
Advanced

[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: k-ohara5a5a
Subject: Re: Avoid floating-point compares on Stem:head_positions; issue 4310 (issue 217720043 by address@hidden)
Date: Thu, 12 Mar 2015 03:25:20 +0000

On 2015/03/11 18:14:37, dak wrote:
On 2015/03/11 16:36:44, Keith wrote:
> I think a standard-conforming implementation should give
bit-identical
> floating-point results for these parallel computations,

No, not at all.  In C++, any computation may be carried out at any
precision at
least as high as that of the operands.  Only when the results are
stored in a
variable (or possibly explicitly cast to some fp type) is it
guaranteed that the
precision is not higher than specified.

If we indeed do the equivalent of n*x/x, we are no longer guaranteed
that
starting from an integer n we arrive at an integer, and when we do
this in two
separate code paths, one calculation may end up as an integer while
another
doesn't.


Oh.  That's probably it, then.

https://codereview.appspot.com/217720043/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]