Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 30 May 2011 22:36:40 -0500 From: Pete Becker Organization: Roundhouse Consulting, Ltd. Newsgroups: comp.lang.c++ Date: Mon, 30 May 2011 17:36:40 -1000 Message-ID: <2011053017364047009-pete@versatilecodingcom> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: implicit promotion User-Agent: Unison/2.1.4 Lines: 24 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-L9Q7JbIUpBRhoCF9mDsv4GakeMDxIfbey3lNlyfcJQHzJ9G33rRyPl2GKSNV5PK3Q6Q/LjIW4LOF5RK!Ki8T2COW5FIotP4vsRSNNtgu5d1mJCnjJgJBo1TOQc4P5rerSJcUwpdyaz5JN96ickoc9II= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html 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: 1959 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:5869 On 2011-05-30 15:24:13 -1000, Ruben Safir said: > On Mon, 30 May 2011 09:23:52 -1000, Pete Becker wrote: > >> Nobody's bothered by 3*(1/3) not being 1, but somehow there's a >> perception that there's something unsavory about 10*(1.0/10.0) not >> having to be 1, even though it's exactly the same issue. > > These are both huge problems that really shouldn't happen. It's crazy. > You have to do 3 *(1.0f/3.0f) in order to get a mathmatically valid > calculation that a standard calculator does. > > Just nuts... Actually, the "standard calculator" is lying to you. It didn't get 1.0, but it rounded the value to display it. Try subtracting 1.0 from that result. -- Pete Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)