List Info

Thread: float -> double




float -> double
country flaguser name
Czech Republic
2007-07-17 07:59:06
 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?

-- 
Lubos Lunak
KDE developer
------------------------------------------------------------
--
SUSE LINUX, s.r.o.   e-mail: l.lunaksuse.cz , l.lunakkde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz
_______________________________________________
Kwin mailing list
Kwinkde.org
https://ma
il.kde.org/mailman/listinfo/kwin

Re: float -> double
country flaguser name
Estonia
2007-07-17 12:57:02
Ü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.

Rivo
_______________________________________________
Kwin mailing list
Kwinkde.org
https://ma
il.kde.org/mailman/listinfo/kwin

Re: float -> double
country flaguser name
Czech Republic
2007-07-19 05:16:58
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  ?

-- 
Lubos Lunak
KDE developer
------------------------------------------------------------
--
SUSE LINUX, s.r.o.   e-mail: l.lunaksuse.cz , l.lunakkde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz
_______________________________________________
Kwin mailing list
Kwinkde.org
https://ma
il.kde.org/mailman/listinfo/kwin

Re: float -> double
country flaguser name
Estonia
2007-07-19 05:36:18
Ü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
Kwinkde.org
https://ma
il.kde.org/mailman/listinfo/kwin

Re: float -> double
country flaguser name
Czech Republic
2007-07-20 06:25:09
On Thursday 19 of July 2007, Rivo Laks wrote:
> Ü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.

 Ok.

-- 
Lubos Lunak
KDE developer
------------------------------------------------------------
--
SUSE LINUX, s.r.o.   e-mail: l.lunaksuse.cz , l.lunakkde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz
_______________________________________________
Kwin mailing list
Kwinkde.org
https://ma
il.kde.org/mailman/listinfo/kwin

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )