ncalc icon indicating copy to clipboard operation
ncalc copied to clipboard

Prime factor dot display broken for N ≥ 1024

Open mb64 opened this issue 4 years ago • 0 comments

With the new update, the "Prime Factor" screen is unable to show the factorization of integers when they are too large.

It's not a problem with the FactorInteger routine, which works fine when run in a program.

Much of the time, it simply fails to display the factorization (in any form), but it sometimes crashes. The limit seems to be n=1024. At n=1023, it displays it fine, but at n=1024 it fails.

Sometimes, it crashes. One repeatable way of making it crash for me by going to the "Factor Integer" screen, entering 1050 and pressing calculate (nothing is shown), entering 96 and pressing calculate (it shows its factorization), and entering 1050 again (it crashes with an IndexOutOfBoundsException).

The specific text of the exception is java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid view holder adapter positionb{64a777f position=2 id=-1, oldPos=1, pLpos:1 scrap [attachedScrap] tmpDetached no parent} androidx.recyclerview.widget.RecyclerView{... (it continues, but I'm not sure how to copy-paste it and don't have the patience to type it all in). The stack trace is almost entirely android.{view, widget}.

My phone is Android 6.0 (SDK 23), in case it's relevant.

mb64 avatar Nov 18 '19 22:11 mb64