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

Sum/Product fix #869

Merged
merged 3 commits into from
Sep 12, 2020
Merged

Sum/Product fix #869

merged 3 commits into from
Sep 12, 2020

Conversation

GarkGarcia
Copy link
Contributor

Fixed a bug concerning the behaviour of the Sum and Product builtins.

Before the patch

In[1]:= Sum[f[i], {i, 1, 7}]
Out[1]= 7 f[i]

After the patch

In[1]:= Sum[f[i], {i, 1, 7}]
Out[1]= f[1] + f[2] + f[3] + f[4] + f[5] + f[6] + f[7]

@GarkGarcia GarkGarcia added the bug label Sep 12, 2020
@GarkGarcia
Copy link
Contributor Author

After the patch

In[1]:= Sum[f[i], {i, 1, 7}]
Out[1]= f[1] + f[2] + f[3] + f[4] + f[5] + f[6] + f[7]

Note that this is the behaviour exhibited by WolframAlpha.

@GarkGarcia
Copy link
Contributor Author

Apparently https://travis-ci.org/github/mathics/Mathics/jobs/726583048 failed because https://files.pythonhosted.org/ reset the connection while setup.py was downloading something. I'm merging the PR since there aren't any failing tests.

@GarkGarcia GarkGarcia merged commit c1c38ad into mathics:master Sep 12, 2020
Copy link
Member

@rocky rocky left a comment

Choose a reason for hiding this comment

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

We could have this fix added to the tests if

>>> Sum[f[i], {i, 1, 7}]
= Out[1]= f[1] + f[2] + f[3] + f[4] + f[5] + f[6] + f[7]

were added to the Sum builtin.

@GarkGarcia
Copy link
Contributor Author

We could have this fix added to the tests if

>>> Sum[f[i], {i, 1, 7}]
= Out[1]= f[1] + f[2] + f[3] + f[4] + f[5] + f[6] + f[7]

were added to the Sum builtin.

Good idea! Check #873 for updates.

@GarkGarcia GarkGarcia changed the title Sum product fix Sum/Product fix Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants