answersLogoWhite

0

function complement(num, base){

var result = 0, column = 0;

if(base < 2) return null;

while(num > 0){

digit = num % base;comp = base - 1 - digit;result += comp * Math.pow(base, column);column++;num -= digit;num /= base;}

return result;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Does a java script operator perform mathematical operation on 2 numbers?

some times


What is java fx2.1.1?

Java script


Is Java script needed for Poptropica?

No, Java script is not needed to play poptropica.


Find java script download application?

kw bah c sheila answer


Does Java Script use the same compiler as Java?

No


What are good Java script codes?

depending on the intention of the javascript codes you wish to write. there is much you can do with javascript but the only way to find out what "good Java script codes" are is to explore what you want the Javascript to do on the page.


Where can I download java script free?

When it comes to java script you can simply download it free from the java website. You can also go to CNET downloads and get it free from there.


Does java script coding mean using it for Java programs only?

Java script coding is computer coding, many things require Java, and you need to have Java enabled to view these types of programs.


Does iPod touches have java script?

they have java&lt; javascript and flash


Which script based on sound?

Java script is based on sound.


Where is the best place to download java script free?

Java script is the name of a computer language. The Java website, http://www.java.com/en/download/index.jsp, is the best place to download Java software.


Why java applet is executed faster than java script?

The java applet is in the java language and is run local to your computer, java script is in the language java script, this can be run local to server or computer. Java and java script are to different languages that run two different ways.