Skip to content

Add function to return an array of the digits of an integer #36

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

Closed
delphidabbler opened this issue Jan 6, 2025 · 1 comment
Closed
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@delphidabbler
Copy link
Owner

Name the function, DigitsOf.

The function should return a byte array containing the digits of a given integer, with the most significant digit being the first element of the array and the least significant digit being the last element.

For negative integers, only the digits are to be returned. The sign of the number will be discarded.

The function should work for different bases. Returned digits are in decimal, so the digits value of 15 in hex will be [15], while the digits of the same value in decimal will be [1,5].

Zero will be treated as a special case: [0] will be returned rather than an empty array.

@delphidabbler delphidabbler self-assigned this Jan 6, 2025
@delphidabbler delphidabbler added the accepted Issue will be actioned label Jan 6, 2025
@github-project-automation github-project-automation bot moved this to Considering in Code Snippets Jan 6, 2025
@delphidabbler delphidabbler moved this from Considering to Accepted in Code Snippets Jan 6, 2025
@delphidabbler
Copy link
Owner Author

delphidabbler commented Jan 7, 2025

Implemented by commit cfadac8 as part of implementation of issue #17.

This issue has been closed as a duplicate, since issue #17 came first.

@delphidabbler delphidabbler added enhancement New feature or request completed Issue completed and committed to develop. To be closed on next release and removed accepted Issue will be actioned labels Jan 7, 2025
@delphidabbler delphidabbler moved this from Accepted to Completed in Code Snippets Jan 7, 2025
@delphidabbler delphidabbler added this to the Next Release milestone Jan 7, 2025
@delphidabbler delphidabbler added duplicate This issue or pull request already exists completed Issue completed and committed to develop. To be closed on next release and removed enhancement New feature or request completed Issue completed and committed to develop. To be closed on next release labels Jan 7, 2025
@delphidabbler delphidabbler removed this from the Next Release milestone Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant