Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Pure VPN - Up to 27 Months
vgp
Updated:
Today at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
C help
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="OptiplexFx" data-source="post: 5011607" data-attributes="member: 208281"><p>& is a Bit wise AND operator, if you take j&0x01 that means whatever the value of j is compared with the value 0x01(hex) which is 00000001, and only the bits equal (in this case the right most one is returned as the value).</p><p>In the above example take value 12</p><p>Which translates in binary to 1100</p><p>The recursive procedure does a bit shift to right each time until all the bits are shifted. That would look like this :</p><p>[CODE]</p><p>1100</p><p>0110</p><p>0011</p><p>0001</p><p>0000[/CODE]</p><p>And if you take the bit wise AND with that value and print in the recursive (reverse) order you’ll get something like this :</p><p>[CODE]0001 & 00000001= 1</p><p>0011 & 00000001= 1</p><p>0110 & 00000001= 0</p><p>1100 & 00000001= 0[/CODE]</p><p></p><p>Since you are printing from left to right your string will look like 1100 which is the binary representation of 12.</p></blockquote><p></p>
[QUOTE="OptiplexFx, post: 5011607, member: 208281"] & is a Bit wise AND operator, if you take j&0x01 that means whatever the value of j is compared with the value 0x01(hex) which is 00000001, and only the bits equal (in this case the right most one is returned as the value). In the above example take value 12 Which translates in binary to 1100 The recursive procedure does a bit shift to right each time until all the bits are shifted. That would look like this : [CODE] 1100 0110 0011 0001 0000[/CODE] And if you take the bit wise AND with that value and print in the recursive (reverse) order you’ll get something like this : [CODE]0001 & 00000001= 1 0011 & 00000001= 1 0110 & 00000001= 0 1100 & 00000001= 0[/CODE] Since you are printing from left to right your string will look like 1100 which is the binary representation of 12. [/QUOTE]
Insert quotes…
Verification
Hath warak paha keeyada? (hatha wadikireema paha)
Post reply
Top
Bottom