SUMMARY KCalc should support double factorials, as it currently calculates them as (x!)! instead. STEPS TO REPRODUCE 1. Calculate 7!! OBSERVED RESULT Result is (7!)! EXPECTED RESULT Result is 7!!, or 105 SOFTWARE/OS VERSIONS Windows: N/A macOS: N/A (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: KDE Plasma Version: N/A KDE Frameworks Version: N/A Qt Version: N/A ADDITIONAL INFORMATION None.
Hi! I am a student and new to KDE development. I would like to try implementing this double factorial (!!) feature. I plan to investigate the knumber logic and the parser to see how to handle the double exclamation mark. If I get stuck, I will let you know so someone else can take over.
(In reply to ajay from comment #1) > Hi! I am a student and new to KDE development. I would like to try > implementing this double factorial (!!) feature. I plan to investigate the > knumber logic and the parser to see how to handle the double exclamation > mark. If I get stuck, I will let you know so someone else can take over. Seems that GNU GMP actually implements mpz_2fac_ui, seems that is the function you a looking for, follow/copy any other function implementation (factorial would be ideal) code to implement this new function. Start in the KNumber library.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kcalc/-/merge_requests/207