[haiku-development] Re: Sound of Silence...

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 02 Jun 2009 18:01:44 +0200 CEST

Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> > The position computation is only correct (even if it could be
> > simplified) if "min" is negative - which is the whole point of the 
> > red
> > vs. green color, anyway. The volume currently goes from -60 to +18 
> > dB,
> > btw.
> 
> The computation looks interesting nevertheless. Usually it holds:
> 
>       max - min - max == -min
> 
> And one can just hope that the compiler doesn't actually multiply by 
> 1.0f. 
> I'd replace the above by:
> 
> float position = (float)min / (min - max);

I guess you mean "(float)-min" here :-)

Bye,
   Axel.


Other related posts: