[Qt-interest] Convert a qreal to String

Nuno Correia npaulo.nuno at gmail.com
Thu Jun 18 11:59:22 CEST 2009


2009/6/18 Nuno Correia <npaulo.nuno at gmail.com>

> In Qt documentation
> ....
> typedef qreal
>
> Typedef for double on all platforms except for those using CPUs with
> ARM architectures. On ARM-based platforms, qreal is a typedef for
> float for performance reasons.
> ....
>
> 2009/6/18 Srdjan Todorovic <todorovic.s at googlemail.com>:
> > 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/4832b731/attachment.html 


More information about the Qt-interest-old mailing list