Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!