Skip to content

Added math and bit manipulation snippets for java #230

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

Merged
merged 9 commits into from
Jan 13, 2025

Conversation

Mcbencrafter
Copy link
Contributor

@Mcbencrafter Mcbencrafter commented Jan 11, 2025

Description

Added snippets for java including:

  1. Math
  • calculating the greatest common divisor (gcd) and the least common multiple (lcm) of two numbers
  • calculating a checksum of a number
  • calculating the factorial of a number
  • calculating the nth fibonacci number
  • checking if a number is a prime
  1. Bit Manipulation
  • checking if number is a power of two
  • counting the bits in an int

I also capataliezed the titles of date/time snippets because they did look weird and most snippet titles are already capataliezed.

Type of Change

  • ✨ New snippet
  • 🛠 Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

None

Additional Context

Screenshots (Optional)

Click to view screenshots

Copy link
Collaborator

@Mathys-Gasnier Mathys-Gasnier left a comment

Choose a reason for hiding this comment

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

A little change, but overall great work

@Mcbencrafter
Copy link
Contributor Author

I noticed I forgot to copy an import to the snippet, should be fine now

@Mathys-Gasnier Mathys-Gasnier merged commit 181be5c into quicksnip-dev:main Jan 13, 2025
2 checks passed
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.

3 participants