Re: Bug #13218 Updated: Problema con nXmeros binarios

From: Date: Sun, 09 Sep 2001 10:39:01 +0000
Subject: Re: Bug #13218 Updated: Problema con nXmeros binarios
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-65551@lists.php.net to get a copy of this message
On Sun, 9 Sep 2001, Sander Roobol wrote: > Might be something for the Bug reporting Dos And Don'ts: > -Don't write in any language other than English. I added the note... Derick > > ----- Original Message ----- > From: <derick@php.net> > To: <php-dev@lists.php.net> > Sent: Sunday, September 09, 2001 11:39 AM > Subject: [PHP-DEV] Bug #13218 Updated: Problema con nXmeros binarios > > > > ID: 13218 > > Updated by: derick > > Reported By: manuel@correo.udep.edu.pe > > Old Status: Open > > Status: Bogus > > Bug Type: *Math Functions > > Operating System: Red Hat Linux 7.1 > > PHP Version: 4.0.4pl1 > > New Comment: > > > > Please report bugs in English > bogus > > > > Derick > > > > Previous Comments: > > ------------------------------------------------------------------------ > > > > [2001-09-08 23:03:23] manuel@correo.udep.edu.pe > > > > Intentaba hacer un trabajo con números binarios, primero > > me puse a probar que tan bueno era php con el tratamiento > > de los bínarios dado que no existe ningún tipo de dato > > byte, y me di cuenta del siguiente error: no puede hacer > > bien un AND a dos números y mucho menos negarlos el > > siguiente código es el que probé (una y otra vez) y > > siempre me daba el mismo error: > > > > // Inicio del código > > $num1 = 10101011; > > $num2 = 10000101; > > > > $num11 = base_convert($num1,2,10); > > $num22 = base_convert($num2,2,10); > > > > $num3 = $num11 & $num22; > > $num4 = ~ $num3; > > echo "$num11<br>$num22<br>$num3<br>$num4"; > > // Fin del código > > > > Al correr este código me dió como resultado lo siguiente: > > > > 171 > > 133 > > 131 > > ÎÌÎ > > > > La primera y segunda línea son los números binarios > > convertidos a decimal, esto es correcto. > > > > La tercera línea me debería haber dado como resultado: > > 171 AND 133 = 129, lo cual se puede corroborar en > > cualquier calculadora, por lo tanto es incorrecto!!!. > > > > La cuarta línea debió haber resultado de negar 131 (que ya > > de por sí es erróneo), y debió salir: > > ~ 131 = 1111100 > > y como ven me bota una varible de tipo string sin > > significado alguno. > > > > Verán que el código es completamente sencillo y no hay > > lugar a complicaciones. > > > > Datos Adicionales: > > > > Computadora Pentium III 800MHz > > 128 Mb RAM > > 30 GB HD > > > > > > ------------------------------------------------------------------------ > > > > > > > > Edit this bug report at > > http://bugs.php.net/?id=13218&edit=1 > > > > > > -- > > PHP Development Mailing List <http://www.php.net/> > > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > > For additional commands, e-mail: php-dev-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > Derick Rethans --------------------------------------------------------------------- PHP: Scripting the Web - www.php.net - derick@php.net SRM: Site Resource Manager - www.vl-srm.net ---------------------------------------------------------------------

« previous php.dev (#65551) next »