Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap precedence of negation and factorial #865

Merged
merged 1 commit into from Jun 16, 2023
Merged

Swap precedence of negation and factorial #865

merged 1 commit into from Jun 16, 2023

Conversation

SandaruKasa
Copy link
Contributor

Change calc example's behavior from

> -10!
-10! => ((-10)!) => 1

to

> -10!
-10! => (-(10!)) => -3628800

In my defense:

Well, let’s add ! for factorials. It should bind tighter than -, because -(92!) is obviously more useful than (-92)!.

  • The calculator in the start menu of my KDE Plasma:
    image

all share the same sentiment. That is, -10! = -(10!)

@SandaruKasa SandaruKasa requested a review from a team as a code owner June 15, 2023 22:46
@SandaruKasa SandaruKasa requested review from tomtau and removed request for a team June 15, 2023 22:46
Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@tomtau tomtau merged commit 5ce7b43 into pest-parser:master Jun 16, 2023
9 checks passed
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.

None yet

2 participants