    

 ## On this page

  

 

 # SetBits

 Last update: 17.07.2025 

Returns the input with a number of bits set to either 0 or 1, starting at the given position.

## Interface

NameKindTypeCommentNPN/ASize of the bit-fieldbfIunsigned&lt;&lt;N&gt;&gt;Input bit-fieldpIintegerStart bit position  
Range: \[0, N\[lIintegerNumber of bits to set  
Range: \[0, N-p\[statusIintegerValue to set to the selected bits  
Range: \[0, 1\]vOunsigned&lt;&lt;N&gt;&gt;Result of the operation**Parent topic:**[Bitfield](../../libraries/bitfield/bitfield.md)