Skip to content
Browse files

Minor changes.

  • Loading branch information...
1 parent d36e7f3 commit db045ed2a9b40b29b93f67ea3c03a1ce580966de @kaisellgren committed Aug 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 index.html
View
2 index.html
@@ -627,7 +627,7 @@ <h1 class="title">ECMAScript Series<br /><br />Part 1: Basics</h1>
<p class="to-build">One should not compare decimal numbers without first rounding them. Otherwise, the result cannot be guaranteed.
The reason is because these numbers are stored and processed as binary data which is in base-2, and not in base-10.
Certain decimal numbers cannot be precisely represented in base-2 causing some loss of precision.</p>
- <pre>Math.floor((0.1 + 0.2) * 10) / 10 == 0.3; // true</pre>
+ <pre>Math.round((0.1 + 0.2) * 10) / 10 == 0.3; // true</pre>
</div>
</section>
</div>

0 comments on commit db045ed

Please sign in to comment.
Something went wrong with that request. Please try again.