Skip to content

Implementation of "IsPrime", "Factors", "NextPr", "PrevPr"#1632

Open
jcbenoist wants to merge 4 commits intoc3d:stablefrom
jcbenoist:feature/Factors
Open

Implementation of "IsPrime", "Factors", "NextPr", "PrevPr"#1632
jcbenoist wants to merge 4 commits intoc3d:stablefrom
jcbenoist:feature/Factors

Conversation

@jcbenoist
Copy link

@jcbenoist jcbenoist commented Feb 15, 2026

Implementation of "IsPrime", "Factors", "NextPr", "PrevPr". Tested on sim. I admit the core code is mostly generated by Claude Opus 4.6. I've done the integration to db48. If this PR is accepted, I'll do a test and will update the help files. I want to know first if this code have a chance to be integrated.

Hold on.. I'll develop tests right now, I have some suspiscions. Meanwhile, you can do comments or observations.

No, all seems OK. I'll publish tests soon.

@jcbenoist jcbenoist changed the title Feature/factors Implementation of "IsPrime", "Factors", "NextPr", "PrevPr" Feb 15, 2026
@jcbenoist
Copy link
Author

jcbenoist commented Feb 15, 2026

Tests OK (thanks Claude again). Next step is to add range check in functions. M127 seems a limit for available memory. And test that remultiplying factors gives original number.

I have to know, too, how to check if this is db48x ou db50x, or to check available memory; to set different limits for each hardware?

With reflexion, instead of a range check, is there a graceful detection of stack or RAM overflow to abort a command ? Raw implementation => SEGV in SIM (stack overflow)

@jcbenoist
Copy link
Author

jcbenoist commented Feb 17, 2026

I have enhanced the tests. M73 & M83 fails for unclear reasons, since manually testing them in sim is perfectly OK. Maybe for memory or CPU reasons in a test context ? I have good confidence with the algorithms now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments