[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] Linking your Denemo score to the original source
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] Linking your Denemo score to the original source |
Date: |
Fri, 17 Feb 2012 09:45:08 +0000 |
On Fri, 2012-02-17 at 02:13 +0100, Dominic Sacré wrote:
>
> Actually, the check for event_time == 0.0 is correct, but it should
> be
> better documented.
> It's true that a value of 0.0 has a bit of a special meaning.
> Basically
> there are two kinds of events that are output by denemo: Those that
> are
> part of the score being played back, and those that result from
> immediate user input.
Well, it is perhaps slightly academic, but the compiler would be
entitled to store a different representation of 0.0 than the one it uses
to compare with (e.g. 0.0 and -0.0 differing by the sign flag), and then
the test using == operator should fail. In practice, I guess this really
only arises after operations have been performed on the number when its
underlying machine representation (the actual bits) can vary quite a bit
while still being floating point zero. So for best practice the use of
the == operator with floating point arguments should be discouraged.
Richard