From: Robert Dober Date: 2006-10-01T02:34:51+09:00 Subject: Re: Integer division with / - request explanation of behavior ------=_Part_26564_6280905.1159637688229 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/30/06, Paul Lutus wrote: > > Robert Klemme wrote: > > / ... > > > I > > know a case where a legacy system doing static calculus was replaced by > > a new system on a totally different OS platform. Data was migrated and > > afterwards people complained that the new system was doing the match > > wrong. It turned out that it was the *old* system that actually had th= e > > math wrong. They were lucky that in years no building crashed because > > of this... > > That's a great story. I hope its details are written up somewhere. You ma= y > be aware there is a lot of academic interest in examples where erroneous > computer results come to be accepted, even defended as accurate. > > I am reminded of a scene in "Rain Man" in which the idiot savant played b= y > Dustin Hoffman is asked to provide a difficult mathematical result, while > the questioner simultaneously computes it on a calculator. The savant > replies with the exact number of decimal places that the calculator > produces, no more, no less, for a problem that produces an irrational > result. This is obviously for the benefit of the nonspecialist in the > audience, who would have been *less* impressed if the savant had offered > more digits than the calculator -- those extra digits couldn't possibly b= e > real, could they, otherwise the calculator would have provided them. Would you mind if I suggest this Ruby Quiz compute *all* didgits of Pi, if you have less time, just compute the *last= * digit of Pi. Robert / ... > > >> There's a can of worms. It turns out the behavior of the different > >> languages WRT conversion from and to base ten leads to some borderline > >> failures if the textual forms are transferred between environments. > > > > I am sure, conversion is yet another standard. :-) Or maybe not: > > I think this is part of a standard, and it's usually followed to the > letter. > > / ... > > > The question is whether one should > > rely on the binary <-> text conversion. The best for decimal accuracy > > is probably BCD anyway... > > Yes. My point is that this business of converting between binary and > text/base-ten forms is generally very reliable, both within and between > environments, Perl apparently excepted. > > Not to say that the numbers themselves represent precise quantities, but > that they can be reliably converted and compared to each other. > > -- > Paul Lutus > http://www.arachnoid.com > > --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_26564_6280905.1159637688229--