Bug 501399 - Calculate Gamma function for factorial of fractional numbers
Summary: Calculate Gamma function for factorial of fractional numbers
Status: ASSIGNED
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: 24.12.2
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Gabriel Barrantes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-12 09:54 UTC by alerikaisattera
Modified: 2025-03-25 02:18 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alerikaisattera 2025-03-12 09:54:43 UTC
SUMMARY
Currently, attempting to calculate factorial of a fractional number calculates factorial of its integer part. It would be a lot better if it calculated Pi function, the extension of factorial to fractional numbers

STEPS TO REPRODUCE
1. Input a fractional number into KCalc (ex: 0.5)
2. Calculate its factorial

OBSERVED RESULT
Factorial of integer part is calculated (in this case, 1)

EXPECTED RESULT
Pi function is calculated (in this case, number equal to sqrt(pi)/2)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Even Windows calculator does this
Comment 1 fanzhuyifan 2025-03-13 01:44:38 UTC
I think either an error should be displayed or the gamma function should be calculated -- just using the integer part is unexpected.

Fwiw the android calculator just displays an error.
Comment 2 alerikaisattera 2025-03-13 09:37:28 UTC
Gnome calculator also calculates Gamma/Pi function as factorial of fractional numbers. It's really weird to see a feature present in Gnome and Windows but absent from KDE
Comment 3 Gabriel Barrantes 2025-03-14 18:59:25 UTC
Yeah, that's probably legacy, it can be fixed no problem.

what would make more sense? use gamma?
Comment 4 Bug Janitor Service 2025-03-25 02:18:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kcalc/-/merge_requests/180