- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
In the following example, when 0.3 is added with 0.6 the result must be 0.9 but since there are rounding errors the resulted value is not the intended value as shown in the output.
<html> <body> <p id="F-P-A"></p> <script> var err = 0.3 + 0.6; document.getElementById("F-P-A").innerHTML = "0.3 + 0.6 = " + err; </script> </body> </html>
0.3 + 0.6 = 0.8999999999999999
In the following example, when 0.2 and 0.1 were added the intended result is 0.3 but because of rounding error, the intended value is not the resulted value.
<html> <body> <p id="F-P-A"></p> <script> var err = 0.2 + 0.1; document.getElementById("F-P-A").innerHTML = "0.2 + 0.1 = " + err; </script> </body> </html>
0.2 + 0.1 = 0.30000000000000004
- Decimal fixed point and floating point arithmetic in Python
- Binary Search for Rational Numbers without using floating point arithmetic in C program
- Signed floating point numbers
- C++ Floating Point Manipulation
- What is Floating-Point Representation in Computer Architecture?
- Floating-point hexadecimal in Java
- Floating point comparison in C++
- Fixed Point and Floating Point Number Representations
- PHP Floating Point Data Type
- What is the precision of floating point in C++?
- Floating-point conversion characters in Java
- Format floating point number in Java
- What are C++ Floating-Point Constants?
- Format floating point with Java MessageFormat