pythonguis/pythonguis-examples

calculator: input integer overflows when > 0x7FFFFFFF(or 2147483647)

liuqun opened this issue · 0 comments

QLCDNumber overflows when input >= 2147483648. (For example: input 9999999999...9)

https://github.com/mfitzp/15-minute-apps/blob/b99eb330310fe7302ead39473ef0d34cccb3d12d/calculator/calculator.py#L62-L67

Since integer has an limit of 0x7FFFFFFF(or 2147483647), casting it into float using self.stack[-1] = float(v) would be better.

Patch code: liuqun@a960653