<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aniketnangare on Medium]]></title>
        <description><![CDATA[Stories by Aniketnangare on Medium]]></description>
        <link>https://medium.com/@aniketnangare87?source=rss-15013f1c77f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jD8ULcuWHmJdJyFN</url>
            <title>Stories by Aniketnangare on Medium</title>
            <link>https://medium.com/@aniketnangare87?source=rss-15013f1c77f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 12:08:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aniketnangare87/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bit Manipulation Basics In Programming]]></title>
            <link>https://medium.com/@aniketnangare87/bit-manipulation-basics-in-programming-9f6eb0bc5049?source=rss-15013f1c77f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f6eb0bc5049</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aniketnangare]]></dc:creator>
            <pubDate>Fri, 23 Dec 2022 03:25:00 GMT</pubDate>
            <atom:updated>2022-12-23T03:27:08.892Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*zm25KetMepU8eZJKOMldxQ.jpeg" /><figcaption>Bit Manipulation</figcaption></figure><p>Bit manipulation is a technique for manipulating individual bits in a value stored in a computer’s memory. It is a powerful tool for optimizing code and improving the performance of algorithms, and it is used in a wide range of applications, from low-level system programming to high-level data analysis. In this article, we will explore the basics of bit manipulation and look at some examples of how it can be used.</p><p>To understand bit manipulation, it is helpful to first understand how computers represent data in memory. All data in a computer is stored as a series of bits, which are the smallest unit of data that can be represented. A bit can have a value of either 0 or 1, and it is usually represented as a binary digit (or “bit”) in computer memory.</p><p>There are several ways to manipulate bits in a value. One of the most basic techniques is bit shifting, which involves moving the bits in a value left or right by a specified number of positions. For example, consider the following binary value:</p><pre>10101010</pre><p>If we shift this value one position to the left, we get the following result:</p><pre>01010100<br></pre><p>Notice that the leftmost bit (1) has been lost and a 0 has been added to the rightmost position. This is known as a “logical shift,” and it is equivalent to multiplying the value by 2. If we shift the value one position to the right, we get the following result:</p><pre>00101010</pre><p>In this case, the rightmost bit (0) has been lost and a 0 has been added to the leftmost position. This is known as a “logical shift right,” and it is equivalent to dividing the value by 2.</p><p>Another common operation in bit manipulation is bit masking, which involves using a mask value to zero out certain bits in a target value. For example, consider the following binary value:</p><pre>Copy code</pre><pre>11111111</pre><p>If we apply a mask value of 01010101 to this value, we get the following result:</p><pre>Copy code</pre><pre>10101010</pre><p>Notice that the mask value has zeroed out the bits that are 0 in the mask, leaving only the bits that are 1 in the mask. This can be useful for isolating certain bits in a value or for setting certain bits to a specific value.</p><p>Bit manipulation can also be used to perform bitwise operations, such as AND, OR, and XOR. These operations work by performing a logical operation on each bit in the values being operated on. For example, consider the following binary values</p><pre>10101010<br><br><br>01010101</pre><p>If we perform a bitwise AND operation on these values, we get the following result:</p><pre>00000000</pre><p>This is because the AND operation returns 1 only if both input bits are 1, and in this case, there are no bits that are 1 in both values. If we perform a bitwise OR operation on the same values, we get the following result:</p><pre>11111111</pre><p>This is because the OR operation returns 1 if either input bit is 1, and in this case, all of the bits are 1 in at least one of the values.</p><p>Bit manipulation can be a powerful tool for optimizing code and improving the performance of algorithms. It is commonly used in low-level system programming, but it can also be useful in higher-level applications such as data compression and encryption. However, it can also be complex and error-prone, so it is important concept to know .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f6eb0bc5049" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>