X-Received: by 10.236.207.164 with SMTP id n24mr131287yho.5.1409230258541; Thu, 28 Aug 2014 05:50:58 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!i13no3844357qae.1!news-out.google.com!ef6ni1498igb.0!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail NNTP-Posting-Date: Thu, 28 Aug 2014 07:50:57 -0500 Message-ID: <53FF25AF.6010805@iinet.net.au> Date: Thu, 28 Aug 2014 22:50:55 +1000 From: RobG User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 Newsgroups: comp.lang.javascript To: "Christoph M. Becker" Subject: Re: IE and IEEE 754 References: In-Reply-To: Lines: 37 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 124.170.75.98 X-Trace: sv3-C38dKbeOSRIUvmhX0PUOi6mp4rWOVfen0MyQFIEV6RAd6SSC6HZyr8oInAbd3pSyunpDNBG2MfxFVwr!Q5aHzZj9sD/YKIsVHGdi+GXrcRyDThFUMyDfm7fJFLOx68yjmILm6JYJGR21PZL8XZmDvtr8 X-Complaints-To: abuse@westnet.com.au X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2075 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Xref: csiph.com comp.lang.javascript:25759 On 28/08/2014 6:08, Christoph M. Becker wrote: > RobG wrote: > >> In most browsers: >> >> 0.57 + 8.36 + 3.36 + 0.19 = 12.479999999999999 >> >> in IE it returns: >> >> 12.479999999999998 >> >> Is IE wrong, or is the above difference allowable within IEEE 754? > > Both string representations will be parsed as the same double-precision > 64-bit binary format IEEE 754 value[1]: > > 100000000101000111101011100001010001111010111000010100011110101 > > (Therefore: 12.479999999999999 === 12.479999999999998) > > The different string representation is allowed for conforming ECMAScript > implementations according to ECMA-262 5.1 Edition, section 9.8.1 step 5[2]. > > [1] > [2] Thanks, that seems definitive. -- Rob -- Rob