Any fancy math, do in C++ with a floating-point library and pass to JS/QML as a string purely for the intent of displaying in the UI. The only exception should be for layout / item positioning. There are single JS file floating point libs but… Use C++ :P
Disclaimer: This is just a suggestion and could likely be wrong. Definitely defer to anything anyone else suggests on this mailing list as they are all smarter than me! On 7/12/17, 10:55 AM, "Interest on behalf of Thiago Macieira" <[email protected] on behalf of [email protected]> wrote: On quarta-feira, 12 de julho de 2017 02:53:39 PDT Shantanu Tushar wrote: > qml: Opening 5762702576189441 > Opening 5762702576189442 > > As you can see the number changes. What am I doing wrong? Expecting JS numbers to be precise. Remember that in JavaScript, numbers are actually double-precision floating point. They are lossy. They can represent with fidelity only in the range ±2^53. Yours is inside the range (only just!) but a simple manipulation of it could throw it outside for a while. I recommend staying well away from the limits. Like limiting to 32 bits. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest _______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
