Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7727351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:26:16+00:00 2026-06-01T05:26:16+00:00

I came accross a weird problem, I want to do some basic math checks.

  • 0

I came accross a weird problem, I want to do some basic math checks. I have read to avoid floating numbers so I decided to multiply my math values with 10000, because my value can be between 0.9 and 0.0025.

Everything works correct except for two values: 0.56 and 0.57:

var result = 0.57 * 10000

The outcome is: 5699.999999999999, I hoped for 5700!! And 0.56 is also going wrong but all the other values are correct, what am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:26:18+00:00Added an answer on June 1, 2026 at 5:26 am

    Your choices in Javascript (indeed, in most languages) are integers or floating point numbers. If you write “0.57” you are forcing it into the world of floating point, where accuracy is limited.

    If you want absolute accuracy, you’ll need to work exclusively in integers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just came across a weird error: private bool GetBoolValue() { //Do some logic
I came across the following weird chunk of code.Imagine you have the following typedef:
I came accross a very strange problem with tr1::regex (VS2008) that I can't figure
Today we came accross a problem concerning static member functions in an multithreaded environment.
I just came across this weird problem that is happening in IE. In the
Hello good people i came accross a weird behaviour in my test.I'm using JPA
I recently came across some weird looking class that had three constructors: class Class
I came accross the following situation: I have 2 view models and a single
This is kinda weird problem we came across with my friend. We located our
Possible Duplicate: Strange floating-point behaviour in a Java program I came across this weird

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.