On quarta-feira, 15 de fevereiro de 2012 07.38.44, gunnar.sle...@nokia.com
wrote:
> Our initial idea was to change "qreal" to "double" to avoid any potential
> regression but the impact on size combined with the fact that the added
> precision is almost never needed changed our minds
> (https://bugreports.qt-project.org/browse/QTBUG-23758)

There is one reason for choosing double though: it can store any 32-bit
integer without loss of precision. So doubles can be used to pass around pixel
coordinates that are 32-bit integers. That's the reason Wayland chose to use
it for all coordinates.

Float has 24 bits of mantissa precision, which is enough for 16777216x16777216
pixels. Probably good enough I'd say.

I think the most important thing is to unify the definition. Every time I met
someone from Canonical, they asked me about it because trying to build Qt-
based software on ARM revealed lots of float-double mistakes.

Note: changing qreal to float is source-incompatible and requires manual fixups
where it breaks. But it's not silent.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to