Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
Negative or Positive Number to 32 Bit Binary Data in JS

I want to convert a number to 32 Bit binary data. When I try to convert a number to 16 bit or 8 bit data, there is no any problem. But When I try 32 Bit, result is not correct.

8 Bit example:

-1 & 255 //result -> 255 or -1 & 0xFF //result -> 255

16 Bit example:

-1 & 65535 //result -> 65535 or -1 & 0xFFFF //result -> 65535

Wrong result in 32 Bit

-1 & 4294967295 //result -> -1 or -1 & 0xFFFFFFFF //result -> 4294967295

My expectation in 32 bit, result is 4294967295. -1 is not a correct answer.

How can solve my problem. Thanks

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I found answer of my question.

this is not working for 32 bit

-1 & 4294967295

this is working for 32 bit

-1 >>> 0 //result -> 4294967295

but I don't understand the reason of this error.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda