Greetings,
I'm a bit new to javascript, so excuse my ignorance here.
The result of this operation is something along the lines of: "9.53674316406E-07". What does that number mean exactly, and why does it occur?
This result also occurs in the PHP language. I came across this situation when logging my trades to a database. I thought it may be due to the length of the number, but it seems to occur with the values in my database which are rounded to 2 places! Which doesn't seem to make much sense...because I can't reproduce it.
Any thoughts?
Cheers,
Joshua C. Bergeron
I'm a bit new to javascript, so excuse my ignorance here.
PHP Code:
var n1 = -0.049999237060546875;
var n2 = 0.05000019073486328;
var p = n1 + n2;
This result also occurs in the PHP language. I came across this situation when logging my trades to a database. I thought it may be due to the length of the number, but it seems to occur with the values in my database which are rounded to 2 places! Which doesn't seem to make much sense...because I can't reproduce it.
Any thoughts?
Cheers,
Joshua C. Bergeron
Comment