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

208
Views
Why parseInt return 1 for 31 bit binary

In C# if I do

var value = Convert.ToInt32("1000000000000000000000000000000", 2);

It will return 1073741824 but when I do the same in javascript,

parseInt(1000000000000000000000000000000,2) 

It return 1 but not 1073741824

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You need to pass string as first parameter

console.log(parseInt("1000000000000000000000000000000",2))

about 4 years ago · Juan Pablo Isaza Report

0

It's because in JavaScript you're lacking the quotation marks :)

parseInt("1000000000000000000000000000000",2) 

works fine.

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!