snipt

Ctrl+h for KB shortcuts

Text only

javascript > math.js

0.3 - 0.2 // 0.09999999999999998
math.number(math.subtract(math.bignumber(0.3), math.bignumber(0.2))) // 0.1
https://snipt.net/embed/259948083580ef7fb062b1ad75aba2fe/
/raw/259948083580ef7fb062b1ad75aba2fe/
259948083580ef7fb062b1ad75aba2fe
text
Text only
4
2019-07-19T04:58:00
True
False
False
Feb 21, 2016 at 11:53 PM
/api/public/snipt/144381/
javascript-mathjs
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>0.3 - 0.2 // 0.09999999999999998 </span><span id="L-2"><a name="L-2"></a>math.number(math.subtract(math.bignumber(0.3), math.bignumber(0.2))) // 0.1 </span></pre></div> </td></tr></table>
float, javascript, math
1
2
3
4
5
6
--- 
+++ 
@@ -0,0 +1,3 @@
+0.3 - 0.2 // 0.09999999999999998
+math.number(math.subtract(math.bignumber(0.3), math.bignumber(0.2))) // 0.1
+
  • somlor
  • 3 years, 4 months ago