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

stop random_coprime from producing error messages in apache2 log #552

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

Alex-Jordan
Copy link
Contributor

No description provided.

@Alex-Jordan
Copy link
Contributor Author

@drgrice1 Does this kill those error messages?

If you ask for random_coprime([2,4], [6,7], [2,5]), then that will call random_coprime([ [], [[2],[4]] ], [6,7], [2,5]). The empty [] represents 1-tuples with gcf 1. The [[2],[4]] is 1-tuples with gcf > 1.

Now the first argument is an array reference of array references, and the recursion begins. The next call will be random_coprime([ [[2,7],[4,7]], [[2,6],[4,6]] ], [2,5]).

And then random_coprime([ [[2,7,2],[4,7,2],[2,7,5],[4,7,5],[2,6,5],[4,6,5]], [[2,6,2],[4,6,2]] ]).

But you can see how in that first step (or later steps in other examples) the first argument could be empty and yet the recursion should continue. That's why it needs to look at @{$newcandidates[0]} || @{$newcandidates[1]}, not just @{$newcandidates[0]}.

@drgrice1
Copy link
Member

I thought it should be || but it was effectively what my other pull request was.

This takes care of the error messages.

@drgrice1 drgrice1 merged commit 2112b44 into openwebwork:PG-2.16 Mar 23, 2021
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.

2 participants