[Qt-interest] Convert a qreal to String

Jesús Fernández Prieto jsfdez at gmail.com
Thu Jun 18 12:02:34 CEST 2009


According to Qt documentation in ARM platform they are using float instead
of double for performance reasons:
http://doc.trolltech.com/4.5/qtglobal.html#qreal-typedef

On Thu, Jun 18, 2009 at 11:26 AM, Srdjan Todorovic <
todorovic.s at googlemail.com> wrote:

> Hi,
>
> On 18/06/2009, Jesús Fernández Prieto <jsfdez at gmail.com> wrote:
> > *QString strNumber;
> >
> > #if defined(__arm__)
> > strNumber=QString::number(float(real));
> > #else
> > strNumber=QString::number(double(real));
> > #endif
>
> Why the extra cast?
> And why the Arm difference?
>
> Wouldn't the compiler for the Arm architecture already typedef double
> to a float if it can't handle a double? Or can you use both but a
> float is faster for that architecture?
>
> Srdjan
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090618/7aff7fda/attachment.html 


More information about the Qt-interest-old mailing list