Le Thu, 22 Oct 2015 19:45:09 +0000, "Rousselot, Richard A" <Richard.A.Rousselot at centurylink.com> a ?crit :
> Doing the following math, why is it that the results are not all returning > "yes"? > > SELECT > (9.2+7.9+0+4.0+2.6+1.3), > case when (9.2+7.9+0+4.0+2.6+1.3)=25.0 then "yes" else "no" > end, > (9.2+7.8+0+3.0+1.3+1.7), > case when (9.2+7.8+0+3.0+1.3+1.7)=23.0 then "yes" else "no" > end, > (9.2+7.9+0+1.0+1.3+1.6), > case when (9.2+7.9+0+1.0+1.3+1.6)=21.0 then "yes" else "no" > end > FROM > sometable; > > Result > 25.0 no 23.0 yes 21.0 no > > I'm sure this has an obvious answer but it isn't jumping out at me. > > Richard > > This communication is the property of CenturyLink and may contain > confidential or privileged > information. Unauthorized use of this communication is strictly prohibited > and may be unlawful. > If you have received this communication in error, please immediately notify > the sender by reply > e-mail and destroy all copies of the communication and any attachments. > _______________________________________________ sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users just for the fun: round-off error... 1/3 has an infinite number of decimal number. meanwhile a computer can only store a finite number of decimal... this is the story who leads Lorenz to talk about his butterfly and the chaos... I do not remember the whole story but iirc that was when he worked on some numerical weather prediction. Data stored in some magnetic device (sound like science-fiction for someone young like me...) and the data in the RAM haven't the same number of decimal, so the calculus after several iterations gave totaly different results... regards, Nicolas J. n.b. : "meanwhile a computer can only store a finite number of decimal..." same in groceries when you see 98c and you have to pay 1$... thiefs!