Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
Excel Add-in for DB2 1.7
wolfSSL 4.0.0
EntityDAC Express 2.2
SecureBridge 9.1
C# HTML to PDF 2019.6.5
PHP Ecommerce Script 3.6
Devart SSIS Data Flow Components 1.11
dbForge Data Compare for PostgreSQL 3.2.15
OrgChart JS 4.9.7
iScripts CyberMatch 1.3.3
AnyGantt JS Gantt Charts 8.7.0
Database Workbench Pro 5.6.8
SentiMask SDK Trial 2.0.193121
dbForge Studio for SQL Server 5.8
ODBC Driver for ASE 2.1.2
Top Code
iScripts CyberMatch 1.3
Database Workbench Pro 5.6.8
dbForge Studio for SQL Server 5.5
Online Course Booking Script 3.04
Availability Booking Calendar PHP 1.0
ATN Site Builder 3.0
ATN Resume Finder 2.0
PHP Review Script 1.0
Devart SSIS Data Flow Components 1.0
IBDAC 6.4
ICPennyBid Penny Auction Script 4.0
The C# PDF Library 1.0
Invoice Manager by PHPJabbers 3.0
MATLAB Support Package for Arduino (aka ArduinoIO Package) 1.0
Azizi search engine script PHP 4.1.10
Top Rated
VisualNEO Web 2018.12.15
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
Chek if a number is a power of two 
File ID: 64512






Chek if a number is a power of two 
Download Chek if a number is a power of two http://code.activestate.com/recipes/577514-chek-if-a-number-is-a-power-of-two/?in=lang-pythonReport Error Link
License: Freeware
Downloads: 27
Submit Rating:
Chek if a number is a power of two  Description
Description: Pretty good way to check if a number is a power of two or not.

License: Freeware

Related: Check, Number, Power, Python

O/S:Windows

Downloads: 27



More Similar Code

Functions that checks if a number is odd or even.

(This is a little bit more complicated than using "mod(x, 2)" if you want error handling for certain cases.)

The function can handle double, single, and integer classes, as well as arrays of these.

* An error is raised if a floating point number is too large so that it is not possible to determine if it is even or odd.
* An error is raised if a...



Pads any amount of images each to power-of-two dimensions, useful for OpenGL programming.



Determines if a number is odd or even by dividing the number by two an seeing if the number is an integer.



Simple function that tells if a point is inside of a mesh, be it concave or convex
The algorithm just finds the intersection points between the facets and a vertical line that passes through the original point. Depending on the relative...



As the power needed to transmit a certain number of bits in
a subcarrier is independent of the numbers of bits allocated to
other subcarriers, it turns out that a greedy approach is optimal.
A greedy algorithm assigns bits to the...



any floating point number is separated into two parts i) integer ii)floating point
for ex if x=-12.93 the program gives -12 and .93 as the two outputs
format:[p,q]=truncate(x);
where x is a floating point number



Fligner-Policello is a non-parametric test of two combined random variables with continuous cumulative distribution. It is a robust rank-order test of treatment effects for populations which assumes neither normality nor equal variances...



The input of the filter is a armonic signal which is sum of two sinusoidal component. The frequency behavior of the filter is chose to attenuate the high spectral component of the input signal with 20 dB.



The function creates a modal dialog consisting of two listboxes. Items can be chosen from one box and transferred or copied to the other. The order of picking is obtained (normal listbox only results in sorted order).

Adoption of the...



If a comment is held for moderation an email message is sent to the comment author with a link to verify the comment author's email address. When the comment author clicks on that link the comment gets approved immediately. This makes discussions...

User Review for Chek if a number is a power of two
- required fields
     

Please enter text on the image