1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 01:18:12 +00:00
Commit graph

3 commits

Author SHA1 Message Date
creator1creeper1
cacac7927b Calculator: Construct KeypadValue precisely from the Clipboard contents
Previously, we would use lossy strtod() conversion. This was bad,
especially since we switched from internally storing Calculator
state in a double to storing it in the KeypadValue class
some time ago. This commit adds a constructor for the KeypadValue
class that is not lossy by using strtoll(). It handles numbers
with and without decimal points as well as negative numbers
correctly.
2021-12-21 13:22:12 -08:00
Musab Kılıç
8936d15efa Calculator: Improve KeypadValue conversion to handle integer values 2021-10-31 12:09:37 +01:00
creator1creeper1
97d2a5799e Calculator: Add KeypadValue class
This commit adds a basic KeypadValue class which abstracts away
Keypad's internal representation in a slightly simpler format.
This will allow arithmetic operations in the Calculator to not
lose any precision. In cases where losing precision is necessary,
an explicit conversion operator to double is provided, as well as
an explicit constructor from double.
2021-08-03 19:12:06 +04:30