[Javascript]0.1 * 0.1 = 0.010000000000000002

SineCosine

I'm still looking for my Tangent
Reaction score
77
Yeap.
I tried it out with a fresh page:
Code:
<html>
    <head>
        <script type="text/javascript">
            window.onload = function () {
                alert(0.1 * 0.1);
            }
        </script>
    </head>
    <body>
    </body>
</html>

The result I got was: 0.010000000000000002 o_O
This is madness =/

[EDIT]
I understand that for numbers with a huge number of digits, funny answers will arise..
But..
This is, more or less, a 2-digit by 2-digit multiplication ._.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
Ahh..
I've been using parseFloat() and .toFixed() too conveniently =/
Time to read <.<
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top