Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Dr J R Stockton Newsgroups: comp.lang.java.programmer Subject: Re: Sorting numeric strings Date: Sun, 6 May 2012 17:50:18 +0100 Organization: Home Lines: 26 Message-ID: References: <2012043021273098748-no@waycom> <0km0q7lrv910pkbfb1lidbdfr3bkfjglui@4ax.com> <3s93q719q1787gb4ihi4fugvn8cvgc8nu2@4ax.com> <29053378.63.1336093904131.JavaMail.geo-discussion-forums@pbctc10> NNTP-Posting-Host: JfH6RRPWQh8XzArFI0xgxA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii X-Complaints-To: abuse@aioe.org User-Agent: Turnpike/6.05-S () X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:14345 In comp.lang.java.programmer message , Fri, 4 May 2012 23:36:52, Martin Gregorie posted: >You may use JavaScript for financial calculations. I would not. >Item: it is normal for currency conversions to be defined as a mandatory >algorithm defined as a set of integer calculations by the network or >authority who control the domain that the currency conversion is made in, >e.g S.W.I.F.T. These do not work if floating point arithmetic is used and >so are non-compliant. JavaScript, using IEEE 754 Doubles, is accurate for addition, subtraction, and multiplication of integers if the operands and results are no greater than 2^53. Division is as accurate as possible under those conditions; one may want to use it in conjunction with Math.round Math.floor or Math.ceil. Assumes not using a really early Pentium CPU. If working in dollars, quarters are safe. -- (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web - FAQish topics, acronyms, & links. Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)