CHANGE BASE:

DECIMAL VALUE:
BASE:

First Digit in Radix and Fraction tells proceeding 0's not that important for N but for fractional digit part.
RADIX OUT:
FRACTION OUT:
BACK TO DECIMAL CONTROL CONVERSION->

Radix HOWTO EXPLAIN
Fractions HOWTO EXPLAIN
(Programmers)TRASHCAN

HERE COMES THE CODE YOU CAN USE TO CHANGE INTO BIJECTIVE BASES <HTML><HEAD><TITLE>TEST</TITLE> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <SCRIPT language=Javascript> function anybase() { fullnumber=document.doit.dnumb.value; twoparts = fullnumber.split(","); bas=document.doit.bval.value; twoparts[0] = +twoparts[0]; document.doit.trash.value=twoparts[0]; // Main loop, one for naturals and one for fraction part. (if you just want naturals set loop to one else two) for(loop=0;loop<2;loop++){ basemultip=1; multip=0; unr=0; decimal=twoparts[loop]; entry=0; basestr=""; // Number of zero entries in fraction part while(decimal[entry]==0){ entry++; } basestr=entry+","; //Gettin size of first digit(basemultip) (3,9,27 etc...) and nr of multip (1,2,3) etc. while (basemultip<decimal){ basemultip=basemultip*bas; multip=multip+1; } //While decimal have value bigger then zero. while (decimal>0){ unr++; set=0; //Here we loop for each basmultip and get the digit while decimal>0 //Loop Basmultip= 27 i=bas for i= 3-->2-->-->1 [next loop] basmultip=9 for i= 3-->2-->1 [next loop] basmultiple=3 i=3 for i=3-->2-->1 //If decimal = subtrahend we add the ***digit=basestring*** in that position. for(i=bas;i>0;i--){ subtrahend=basemultip*i; //******Somewhere here code must change to get NyaN //******I thought by say that if the bas*basemultip e.g 3*27 equals decimal 81 //******We can move down multiple by using two IF (decimal=subtrahend) or IF (decimal>subtrahend) but i can not get it to work. //******If subtrahend=decimal) {basemultip=basemultip/bas;} if (decimal==subtrahend) { basemultip=basemultip/bas; //subtrahend=subtrahend-subtrahend; } if (decimal>=subtrahend) { decimal=decimal-subtrahend; set=1; basestr=basestr+i+","; } } if(set==0 && decimal!=0)basestr=basestr+0+","; basemultip=basemultip/bas; } while (multip>=unr){ basestr=basestr+0+","; unr++; } if (loop==0) {radixout=basestr; document.doit.radix.value=radixout;} if (loop==1) {radixout=basestr; document.doit.fracted.value=radixout;} } control=document.doit.radix.value; controldec=document.doit.fracted.value; fullnumb=document.doit.dnumb.value+"="; parts = fullnumb.split(","); show=""; //Control Radix by go back to decimal darr = control.split(","); decarr = controldec.split(","); prezero=""; prezero=decarr[0]; darr.reverse(); decarr.reverse(); total=0; totalfrac=0; multiple=1 for (i=1;i<darr.length;i++){ cval=darr[i]; cval=cval*multiple; total=total+cval; show=show+"("+multiple+"*"+darr[i]+")+"; multiple=bas*multiple; } pre=""; for (i=0;i<prezero;i++){ pre="0"+pre; } multiple=1 showfrac=""; for (i=1;i<decarr.length-1;i++){ cval=decarr[i]; cval=cval*multiple; totalfrac=totalfrac+cval; showfrac=showfrac+"("+multiple+"*"+decarr[i]+")+"; multiple=bas*multiple; } totalfrac=pre+totalfrac; totalfull=total+","+totalfrac; document.doit.controlout.value=totalfull; document.doit.overview.value=show; document.doit.fracview.value=showfrac; } </SCRIPT> <HTML><BODY> <FORM NAME=doit onSubmit="anybase(); return false;"> CHANGE BASE: <input type=submit value="GO!"><P> DECIMAL VALUE:<TEXTAREA NAME=dnumb COLS=30 ROWS=1>9,0</TEXTAREA><BR> BASE:<TEXTAREA NAME=bval COLS=30 ROWS=1>3</TEXTAREA><P> First Digit in Radix and Fraction tells proceeding 0's not that important for N but for fractional digit part.<BR> RADIX OUT:<TEXTAREA NAME=radix COLS=200 ROWS=1></TEXTAREA><BR> FRACTION OUT:<TEXTAREA NAME=fracted COLS=200 ROWS=1></TEXTAREA><BR> BACK TO DECIMAL CONTROL CONVERSION-> <TEXTAREA NAME=controlout COLS=30 ROWS=1></TEXTAREA><P> Radix HOWTO EXPLAIN<TEXTAREA NAME=overview COLS=200 ROWS=1></TEXTAREA><BR> Fractions HOWTO EXPLAIN<TEXTAREA NAME=fracview COLS=200 ROWS=1></TEXTAREA><BR> (Programmers)TRASHCAN<TEXTAREA NAME=trash COLS=200 ROWS=1></TEXTAREA><BR> </FORM> </BODY> </HTML>