Am Dienstag, 10. Oktober 2006 13:55 schrieb Christian Ohm:
> On Tuesday, 10 October 2006 at 11:59, Dennis Schridde wrote:
> > Am Montag, 9. Oktober 2006 23:15 schrieb Christian Ohm:
> > > On Monday,  9 October 2006 at 19:22, Dennis Schridde wrote:
> > > > Author: devurandom
> > > > Date: Mon Oct  9 21:22:24 2006
> > > > New Revision: 428
> > > >
> > > > URL: http://svn.gna.org/viewcvs/warzone?rev=428&view=rev
> > > > Log:
> > > > Patch by Christian Ohm: Gamma controls
> > >
> > > Why haven't you included my fix for that? The problem is: floats are
> > > not exact. I regularly got numbers like 1.2499999999 instead of 1.25
> > > (reproducible, and this is CPU dependant) - which resulted in the gamma
> > > value being changed to 1.20 on saving (divide by 20 and truncate the
> > > decimals). So I added a little bit when changing the gamma value, to
> > > ensure it never falls below the desired value. The increase in the
> > > gamma value is not significant, you'd have to change it hundreds of
> > > times to notice the difference (but you can add a few decimals more, it
> > > you think it's too large now).
> >
> > Couldn't we reduce the std value from 20 to 1 to compensate this?
> > Float is more precise in the lower end...
>
> Hm, you mean, save the float as is? Then we need to add float support to
> the config file. I thought about that as well, but a) it seemed kind of
> overkill just for the gamma value, and b) the current solution keeps the
> gamma value in nice even steps, while using a float would keep the
> imprecision.
>
> Or we use the integer value everywhere, and convert it to float just
> when we need it. Patch attached, doesn't look as hacky.
>
> Nitpicks: The apostrophe in your comment is wrong, it's just "gets". And
> it's not the float that gets truncated, but the decimals on conversion
> to integer.
Thx for the info, I just didn't know how to express imprecission of floats at 
that time...

> Oh, and a question: is 0.5 different to 0.5f in any way?
0.5 is a double and 0.5f is a float.
I got some warnings in some places where 0.xxx was used, so I started to use 
0.xxxf instead.

Attachment: pgpriJYcnCaru.pgp
Description: PGP signature

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to