[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: float -> double
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2007-07-19 10:36:18
Message-ID: 200707191336.19013.rivolaks () hot ! ee
[Download RAW message or body]

Ühel kenal päeval (neljapäev 19 juuli 2007) kirjutas Lubos Lunak:
> On Tuesday 17 of July 2007, Rivo Laks wrote:
> > Ühel kenal päeval (teisipäev 17 juuli 2007) kirjutas Lubos Lunak:
> > >  Hello,
> > >
> > >  I'd like to change all floats in the code to doubles. Floating point
> > > constants are double by default in C/C++ and I've run into ugly
> > > rounding errors because of mixing doubles and floats. Additionally,
> > > considering things like
> > > http://compilers.iecc.com/comparch/article/94-11-172, I think there's
> > > really not much reason to use floats - anybody disagrees?
> >
> > OpenGL uses floats internally, so I'm not sure if it's a good idea.
> > At least leave all OpenGL stuff (e.g. vertex coordinates, texcoords, etc)
> > to be floats.
>
>  I don't think we need the added precision, but we shouldn't mix the two.
> Since constants are doubles, every computation with a constant is a double
> operation as well. Compiz seems to use floats, but also to strictly use
> float constants like 1.5f, which I don't find very nice :-/ . Ok, which one
> would you prefer :) ?

We should certainly use floats for GL stuff, so I'd prefer to use them.
You're right about the float constants though, just 1.5 would be nicer...
But if you don't want to mix them, I'd still rather prefer floats everywhere.

Rivo
_______________________________________________
Kwin mailing list
Kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic