[Interest] JS numbers to qint64
Ilya Diallo
ilya.diallo at gmail.com
Wed Jul 12 12:31:54 CEST 2017
2017-07-12 12:00 GMT+02:00 Konrad Rosenbaum <konrad at silmor.de>:
> On Wed, July 12, 2017 11:53, Shantanu Tushar wrote:
> > and I see this output-
> >
> > qml: Opening 5762702576189441
> > Opening 5762702576189442
> >
> > As you can see the number changes. What am I doing wrong?
>
> ...you are using JavaScript numbers. All numbers is JS are 32bit floats,
> so naturally when you get to high numerical values you lose precision.
>
That's 64bits actually. For integers you're safe up to (2^53 -1), so the
OP's value should be ok as it's below that value.
Ilya.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170712/7b2fd35d/attachment.html>
More information about the Interest
mailing list