Skip to content

Conversation

@joente
Copy link
Member

@joente joente commented Jan 30, 2025

Description

This pull request add's a function bit_count() for integer type and returns with the number of bits turned on in the integer value.

Usage:

(42).bit_count();  // returns 3 (binary: 0b101010)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Update collection functions test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes

@joente joente self-assigned this Jan 30, 2025
@joente joente merged commit 99bc22b into main Jan 30, 2025
1 check passed
@joente joente deleted the bitcount branch February 7, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants