answersLogoWhite

0

function dec2bin($val){

if($val & 1){

$rval = '1';

}else{

$rval = '0';

}

$val >>= 1;

if($val > 0){

$rval = dec2bin($val) . $rval;

}

return $rval;

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How we can convert decimal number into binary number in foxpro programming?

In FoxPro, you can convert a decimal number to a binary number using the DECIMAL() and STR() functions. First, use DECIMAL() to get the binary representation, then format it as a string using STR(). Here's an example: binaryString = STR(DECIMAL(decimalNumber, 2)). This will give you the binary equivalent of the decimal number.


How do you convert character to decimal integer?

In Excel it is the "code" function. For example, Code("A") = 65


Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


How do you convert 3.5 into a decimal?

You cannot convert a decimal into a decimal!


How do you convert to a decimal 0.2?

0.2 already is a decimal. There is nothing to convert.0.2 already is a decimal. There is nothing to convert.0.2 already is a decimal. There is nothing to convert.0.2 already is a decimal. There is nothing to convert.


How do you convert 29.53 to a decimal?

Convert 29.53 to decimal


What is the INT functions?

The INT function is to convert something into an integer. An integer is a number that goes out two decimal places.


What is the formula in excel for counting base 8?

To convert from decimal to octal, use the function DEC2OCT.EXAMPLE: =DEC2OCT(58, 3) Converts decimal 58 to octal (072).


How do you get a convert a decimal into a percent?

multiply the decimal by 100 to convert it into a percent.


How do you convert in to a decimal number?

The answer will depend on what you want to convert into a decimal number.


How do you use a power of ten to convert a decimal to a decimal?

If the number is already in decimal form, you do not need to do anything to "convert" it to decimal!


How do you convert 9.80 to a decimal?

9.80 IS a decimal so to convert it to a decimal you, very carefully, leave it exactly as it is.