Skip to content

fix number_of_digits bug#2301

Merged
cclauss merged 3 commits intoTheAlgorithms:masterfrom
realDuYuanChao:dev
Aug 12, 2020
Merged

fix number_of_digits bug#2301
cclauss merged 3 commits intoTheAlgorithms:masterfrom
realDuYuanChao:dev

Conversation

@realDuYuanChao
Copy link
Copy Markdown
Member

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@realDuYuanChao realDuYuanChao requested a review from cclauss August 12, 2020 16:06
@realDuYuanChao realDuYuanChao changed the title [fix bug]fix number_of_digits fix number_of_digits bug Aug 12, 2020
>>> num_digits(0)
1
>>> num_digits(-1)
1
Copy link
Copy Markdown
Member

@cclauss cclauss Aug 12, 2020

Choose a reason for hiding this comment

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

Nice to have comprehensive tests!! Please also add a multidigit negative number.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did this. Please review again :)

@realDuYuanChao realDuYuanChao requested a review from cclauss August 12, 2020 16:26
Copy link
Copy Markdown
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

Nice detective work!!

@cclauss cclauss merged commit d687030 into TheAlgorithms:master Aug 12, 2020
@realDuYuanChao realDuYuanChao deleted the dev branch August 16, 2020 14:14
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* fix bug

* test larger negative

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
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