1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +00:00

Calculator: Round small number to prevent crash

Small numbers (smaller than 1e-19) can't be displayed in the calculator.
They provoke a division by zero in Keypad::set_value(), as 10^20
overflows.
This commit is contained in:
Lucas CHOLLET 2022-01-01 21:49:30 +01:00 committed by Andreas Kling
parent 939bf3e864
commit 7532ef78ad
3 changed files with 50 additions and 1 deletions

View file

@ -12,6 +12,7 @@
class KeypadValue {
friend class Keypad;
friend class Calculator;
public:
KeypadValue(i64, u8);