Programmer Mode crashes on inputs larger than max 32-bit signed int
Closed this issue · 1 comments
davjgardner commented
Steps to reproduce:
- Select Programmer mode
- Tap "Hex"
- Input number larger than max 32-bit signed int (e.g. 80000000 or FEEDFACE)
- Press "="
Stack trace:
type: crash
osVersion: google/barbet/barbet:13/TQ3A.230901.001/2023100300:user/release-keys
package: yetzio.yetcalc:11
process: yetzio.yetcalc
processUptime: 77688 + 719 ms
installer: com.android.packageinstaller
java.lang.NumberFormatException: For input string: "FEEDFACE"
at java.lang.Integer.parseInt(Integer.java:747)
at yetzio.yetcalc.views.ProgramCalcActivity.onClick(ProgramCalcActivity.kt:589)
at android.view.View.performClick(View.java:7542)
at android.view.View.performClickInternal(View.java:7519)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29476)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7940)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ExecInit.main(ExecInit.java:49)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
GrapheneOS on Pixel 5a
davjgardner commented
I would recommend at least using the long
datatype for 64-bit integer precision, if not some sort of BigInteger/arbitrary precision number format. Bumping up the precision might also fix #54 which looks to me like a floating point precision rounding error.