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

  • SEARCH
  • Home
  • 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 234735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:12:32+00:00 2026-05-11T20:12:32+00:00

Some Duplicates: 1.265 * 10000 = 126499.99999999999 ????? How is floating point stored? When

  • 0

Some Duplicates:
1.265 * 10000 = 126499.99999999999 ?????
How is floating point stored? When does it matter?
Strange floating-point behaviour in a Java program
Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?
Error in Flash addition

I divide 23 by 40 (23/40). In C this operation results in 0.5749999999999996. But actually it must be 0.575!

How can I fix this?

  • 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-05-11T20:12:32+00:00Added an answer on May 11, 2026 at 8:12 pm

    The problem is because the .575 value doesn’t have an exact representation in floating point encoding. The fix depends on what you have to do with the value as well as the impact of the inaccuracy.

    If it is just a display problem use rounding to 3 decimals and you’ll get the 0.575.

    If it is because of computation inaccuracy, try keeping the value as a fraction which will be exact. You’ll have to store and handle two floating point values but it will be exact. Postpone the effective division to the last moment when you need the result.

    Check if the difference between the two value is relevant for your problem. For instance subtract sqrt epsilon to the value and check how much the change influences the final computation result and compare it with the required or desired precision.

    Unfortunately we have to live with the limitation of real value representation in float. Using 128 bit precision floats will make the error much smaller but not null.

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

Sidebar

Related Questions

Possible Duplicates: Does the 'offsetof' macro from <stddef.h> invoke undefined behaviour? dereferencing the null
Possible Duplicates: I am looking forward to call some javascript method from a java
I'm using MySQL 4.1. Some tables have duplicates entries that go against the constraints.
I want to do some quick inserts but avoid duplicates into a Table. For
I have a JTextArea which consists of lines (some of them possibly duplicates of
Possible Duplicate: Calculate age in JavaScript In some point of my JS code I
Possible Duplicate: I am making some parts of java image transparent by some code,
I have a table called _sample_table_delme_data_files which contains some duplicates. I want to copy
(I know there's some close duplicates out there, but none of them were able
Some thing ago, I write small script using Text::DeDupe to remove duplicates of blog

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.