In general you can think of js numbers as integers or floats, assuming you need less than the 56 bits of resolution. A common misconception is that floating point numbers have some sort of built-in inaccuracy. It took me a while to quit worrying about it.
I even send numbers to jquery/DOM with things like the .0000004 present. It wastes some characters when serializing but that isn't a big problem in the overall scheme of things. On Mon, Dec 31, 2012 at 9:52 AM, Kevin Purnelle <[email protected]>wrote: > Ok thank you, this was my real concern, if repeated imprecision > in operations could lead to inconsistency after some time. :) > > On Monday, 31 December 2012 18:35:41 UTC+1, Mark Hahn wrote: >> >> Just chain using all floats and use toFixed at the end. Floating points >> have all the resolution you need. It doesn't hurt for 0.000004 to hang >> around during the intermediate calculations. >> > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
