Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: IE and IEE 754 Date: Fri, 29 Aug 2014 00:04:48 +0100 Organization: A noiseless patient Spider Lines: 20 Message-ID: <871ts0md0v.fsf@bsb.me.uk> References: <87fvgh1qu9.fsf@bsb.me.uk> <87sikgzz71.fsf@bsb.me.uk> <3souv99slp2vt6nktr48gadd2e4r8th8o4@4ax.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="14284"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/D4nGShRIohK53CPvD6W39G+O8PBujZHY=" Cancel-Lock: sha1:MuK6tDxVHhGAsJkjRCs6GK/D+Wg= sha1:meq/GqSVZ1hyZZVf2ZqUV+ftmwI= X-BSB-Auth: 1.bae455bcefe1c8f11aa2.20140829000448BST.871ts0md0v.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:25767 Gene Wirchenko writes: > On Thu, 28 Aug 2014 11:27:30 +0100, Ben Bacarisse > wrote: > > [snip] > >>I think it must. The ECMAScript specification imports IEEE 754's strict >>rounding and representation rules. The IEEE FP value closest to 123.45, >>when multiplies by 100 must yield 12345 according to those rules. > > Why? What if the value that you have (and want) happens to be > the value closest to 123.45? When you multiply that value by 100, > wouldn't you want 100 times the value instead of 12345? Yes, but you won't get it. You'll get the nearest floating point number, which is 12345. Am I missing your point? -- Ben.