The bit representation of any number of the form 2^n will have only one field set.
If we do an AND operation with the (number-1) the result is 0
i.e (n & n-1) is 0
The number is of form 2^n if (n & n-1) is 0
Read more ...
Search This BlogJul 15, 2008Code to check if a number can be expressed in the form 2^n
The bit representation of any number of the form 2^n will have only one field set. The number is of form 2^n if (n & n-1) is 0 Read more ...
Subscribe to:
Posts
(
Atom
)
|
My Blog List |
Labels
AIX
(
2
)
Algorithms
(
15
)
Apache Axis2
(
2
)
Blogging
(
1
)
C#
(
4
)
CMIS
(
2
)
CPP
(
46
)
css 3
(
1
)
Curl
(
1
)
Cygwin
(
3
)
Data Structures
(
10
)
Debugging
(
1
)
Design Patterns
(
5
)
Development
(
1
)
Eclipse
(
4
)
Encoding
(
2
)
General
(
16
)
Generics
(
3
)
HPUX
(
2
)
html
(
1
)
Http
(
1
)
Inspiration
(
3
)
J2EE
(
2
)
Java
(
43
)
Java Web Start
(
2
)
Javascript
(
1
)
JDBC
(
2
)
JNLP
(
2
)
Linux
(
8
)
maven
(
7
)
Multithreading
(
10
)
Objective C
(
1
)
Recursion
(
1
)
Regular Expressions
(
1
)
Servlet
(
2
)
SharePoint
(
3
)
Shell Scripting
(
3
)
spring
(
7
)
SQL Server
(
1
)
SSH
(
2
)
STL
(
1
)
Telnet
(
1
)
Tomcat
(
2
)
Tools N' Utilities
(
3
)
Tree
(
1
)
Ubuntu
(
1
)
VI Editor
(
1
)
Visual Studio
(
4
)
Web Server
(
1
)
Web Services
(
2
)
Windows
(
14
)
|