Skip to content

Commit 6fc04ce

Browse files
authored
Merge pull request #1 from per1234/fixup-AshutoshPandey123456-patch-2
Requested changes for #750
2 parents 341f158 + 3365681 commit 6fc04ce

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

Language/Functions/Bits and Bytes/bitClear.adoc

+20-13
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ Clears (writes a 0 to) a bit of a numeric variable.
4040
// OVERVIEW SECTION ENDS
4141

4242

43-
// SEE ALSO SECTION
44-
[#see_also]
43+
44+
// HOW TO USE SECTION STARTS
45+
[#howtouse]
4546
--
4647

4748
[float]
@@ -51,26 +52,32 @@ Prints the output of `bitClear(x,n)` on two given integers. The binary represent
5152

5253
[source,arduino]
5354
----
54-
void setup()
55-
{
56-
Serial.begin(9600);
55+
void setup() {
56+
Serial.begin(9600);
57+
while (!Serial) {
58+
; // wait for serial port to connect. Needed for native USB port only
59+
}
60+
61+
int x = 6;
62+
int n = 1;
63+
Serial.print(bitClear(x, n)); // print the output of bitClear(x,n)
5764
}
5865
59-
void loop()
60-
{
61-
int x = 6; int n = 1; //setting the value of x and n
62-
Serial.print(bitClear(x,n)); //printing the output of the bitClear(x,n)
66+
void loop() {
6367
}
6468
----
6569
[%hardbreaks]
6670

67-
[float]
68-
=== Notes and Warnings
69-
The indexing of the rightmost bit starts from 0, so `n=1` clears the second bit from the right. If the bit at any given position is already zero, `x` is returned unchanged.
71+
--
72+
// HOW TO USE SECTION ENDS
7073

71-
Both `x` and `n` must be integers.
7274

75+
76+
// SEE ALSO SECTION
77+
[#see_also]
7378
--
79+
80+
[float]
7481
=== See also
7582

7683
--

0 commit comments

Comments
 (0)