» Home » Movies » Tutorials » Submissions » Sound FX » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops
Search tutorials
Author: Mr.Ehab
4) Function decimalToBinary has the following script:
```function decimalToBinary (number) {
array1.splice(0);
array.splice(0);
for (i = 0; i <= number; i ++) {
binary = Math.pow (2, i);
if (binary > number) {
arrayelement = i - 1;
break;
}
array [i] = binary;
}
for (j = arrayelement; j >= 0; j --) {
if (j == arrayelement) {
binaryelement = int (number / array [j]);
binaryremainder = int (number % array [j]);
array1[ 0 ] = binaryelement;
} else {
binaryremainder1 = binaryremainder;
binaryremainder = int (binaryremainder % array [j]);
binaryelement = int (binaryremainder1 / array [j]);
array1 [arrayelement - j] = binaryelement;
}
}
return array1.join ("");
}
```

This function has the same script as function decimalToOctal but with powers of 2.

5) Function octalToDecimal has the script:
```function octalToDecimal (number) {
array9.splice(0);
array8.splice(0);
for (i = 0; i <= length (number) - 1; i ++) {
array8 [i] = Math.floor (number / Math.pow (10, length (number) - i - 1)) - Math.floor (number / Math.pow (10, length (number) - i)) * 10;
}
decimal1 = 0;
for (j = 0; j < array8.length; j ++) {
array9 [j] = Math.pow (8, array8.length - j - 1);
decimal = array9 [j] * array8 [j];
decimal1 += decimal;
}
return decimal1;
}
```

This function has the same script as function binaryToDecimal but with powers of 8.

 » Level Intermediate Added: 2002-03-04 Rating: 5.83 Votes: 42 1 2 3 4 5 6 7 8 9 10 (10 being the highest) » Author Student studying Computer Engineering and Graphic Design. » Download Download the files used in this tutorial. Download (34 kb) » Forums More help? Search our boards for quick answers!

• There are no comments yet. Be the first to comment!

• You must have javascript enabled in order to post comments.

Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.