Description
QScriptEngine is truncating any integer number in the range [-2^31, 2^31) to zero. Floating point numbers and integers outside this range are not affected. This behavior is not present in 5.10.1. Attached is a simple program that exhibits the problem, giving the following output:
"100" = 0
"100.00001" = 100.00001
"99.5+0.5" = 0
"99.49999999999999+0.5" = 99.999999999999986
"99.49999999999999+0.50000000000001" = 0
"200/2" = 0
"50*2" = 0
"26.8/13.4*50" = 0
"1" = 0
"2147483648" = 2147483648
"2147483647" = 0
"-2147483648" = 0
"-2147483649" = -2147483649
"73786976294838206464" = 7.3786976294838206e+19
"4000000000-2000000000" = 0
"2000000000+2000000000" = 4000000000
"2147483647.000001" = 2147483647.000001
"(function() { return 10; })()" = 0
"(function() { return 10.1; })()" = 10.1
"var x = 10; x" = 0
"var x = 10.1; x" = 10.1
Attachments
For Gerrit Dashboard: QTBUG-68367 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
230148,4 | Fix QtScript on 64-bit systems with gcc 8 | 5.11 | qt/qtscript | Status: MERGED | +2 | 0 |