From: Lloyd Zusman Date: 2002-12-28T00:46:55+09:00 Subject: Re: 1210 / 100 = 12? what? Philipp Meier writes: > On Fri, Dec 27, 2002 at 04:10:59PM +0900, Tom Sawyer wrote: >> On Thursday 26 December 2002 11:42 pm, Brian Wisti wrote: > >> > If you can't tell by my stumbling over the phrasing of this problem, I >> > belong in the first camp. For me in this case, POLS is sticking to the >> > initial types unless explicitly stating or absolutely required >> > otherwise. This behavior is similar to that of other languages, so >> > somebody coming in from one of those other languages would be surprised >> > if "1210/10" did not return 12! >> >> i do see your point, but i think it makes more sense for a strictly typed >> langauge, rather than a dynamic one like ruby. > > And then one could argue that 2/3 should return an instance of "Rational" > which correctly represents the Quotient 2/3 and neither 0.666* in a > language like Ruby. Even 10/100 can lead to strang results because 1/10 > is periodic to a base of 2 (which most modern computers work with). > > -billy. I remember back in 1969 in my Introduction to Computer Programming course (or whatever it was called), some of the first things we learned had to do with fixed point and floating point arithmetic. We spent a good month or so on these and other basic concepts before we were given our first program to write. Do they even teach these basics any more? I'm not trying to disparage anyone here; if something hasn't been taught, then no one can be expected to have learned it. But it's disturbing to me to see the number of people who are posting in this and other newsgroups in recent years who haven't been exposed to the concepts of fixed-point and floating-point arithmetic. This indicates to me that there are many schools these days which don't make the effort to teach these basic concepts to their computer science students. The fault is with these schools, and that's sad. > -- > Meisterbohne S�flinger Stra�e 100 Tel: +49-731-399 499-0 > eL�sungen 89077 Ulm Fax: +49-731-399 499-9 -- Lloyd Zusman ljz@asfast.com