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

Compute the expected result by using an arithmetic series instead of looping and adding [moved] #7

Closed
mikeb01 opened this issue Sep 26, 2012 · 0 comments

Comments

@mikeb01
Copy link
Contributor

mikeb01 commented Sep 26, 2012

This is Issue 7 moved from a Google Code project.
Added by 2011-08-11T22:38:51.000Z by cleh...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Priority-Medium, Type-Enhancement

Original description

Not an issue per se. I just noticed it when looking over the tests and it seemed strange.

The expected result for UniCast unit tests is computed by a loop and an accumulator.
An arithmetic series could be used instead. 
Also the code is duplicated. 

Added getArithmeticSeries to Utils and removed duplication.

Perhaps a less general formula like n(n-1)/2 and single parameter method could be used instead for simplicity. 
@mikeb01 mikeb01 closed this as completed Sep 26, 2012
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

No branches or pull requests

1 participant