De decimal a binario y viceversa

22/07/2004 - 00:17 por Zenkius | Informe spam
Cómo puedo convertir de decimal a binario y viceversa utilizando
C#??? Existe alguna clase que haga esto????

Zenkius.

Preguntas similare

Leer las respuestas

#1 Alejandro Perez
23/07/2004 - 20:51 | Informe spam
Hola Zenkius!, como estas?

Aqui te dejo una funcion que hice hace un tiempo, a ver
si te sirve...

public double BinaryToDouble(string binaryText)
{
int bl=binaryText.Length;

double Decimal=0;
for(int i=1;i<=bl;i++)
{
byte n=byte.Parse(binaryText.Substring(bl-i,1));
if(n==1)
Decimal+=System.Math.Pow(2,i-1);
}
return Decimal;
}


Alejandro Perez
MCSD/MCDBA/MCT
Caracas - Venezuela


Cómo puedo convertir de decimal a binario y viceversa


utilizando
C#??? Existe alguna clase que haga esto????

Zenkius.



.

email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida