Quick Translation (for someone too stupid to comprehend scientific notation)

Back in grade school, the Apple IIc we used had a math game that required the user to solve math programs to get the little guy across the screen. The thing was, in long division mode, the answers would be an unrounded decimal. So, let’s say you had 33569 / 21. The answer it would want would be something like 1.598523809e+3, rather than the more sensible 1598 R11. While I figured out how to do decimal division, my non math-geek friend figured out the odd notation. (Yes, back in 3rd grade. Montessori education is rather good, IMHO.)

For you computer geeks out there, what would be the advantage of using the hard to use floating point operations on a non FPU chip over just doing integer division and a modulus?

I take your challenge! Behold the results of the mighty Edit -> Find -> Replace:


 10,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000

Big T writes:

> So, let’s say you had 33569 / 21. The answer it would want would be
> something like 1.598523809e+3, rather than the more sensible 1598 R11.

The answer, if rounded to the nearest integer, should be 1599, not 1598. What is “R11” doing in there?

It’s the same way for SAP; the questions in the exams to certify consultants are completely irrelevant to the actual work of a consultant and lots of them are things like “What path must be followed to access the transaction Create Process Order?” or “Which value of MSNB-WERKS triggers the process for the frying of an egg which has been whisked into homogeneity?”

The first one, nobody goes via menus; for the second one and if SAP did have a transaction for “make an omelette” there would be a little table with the values and their meanings, and you would select the value from the table.

They’re just a way to milk the people who need the certificate, who by the way need it exclusively because HR (or their industry’s equivalent) have heard it exists and therefore believe it certifies something important.

/hijack

Back to the subject, I was taugt that about the capital-E (“exponential”, it’s easy to remember) vs lowercase-E and so were my father and my maternal grandfather (don’t ask me how come it came up in conversation at the table), but maybe it’s one of those things that change by location.

R11 means remainder 11, as in if expressed in mixed fractional form 33569/11 would be 1598 11/21.

O.K., thanks. I’ve never seen the remainder expressed in that notation before. I wasn’t aware that calculators even had a mode for giving the answer as the quotient and the remainder.

If all you want is a single division, than just calculating the integer part and the remainder is fine, and is often used (I need to do clock arithmetic all the time - how many long is x hours from now? Well, it’s Y days + r hours…). However, if you want to do math (i.e. multiple divisions, trig, exponentiation, etc.) than the integer + remainder form isn’t very useful. I had to write some scaling routines in assembly language on a processor with an 8 bit ALU, no division, and no FPU. The easiest way to do this ended up being fixed point arithmetic. This was only possible because I knew the range of values going into the problem - it can’t be used for arithmetic that spans enormous ranges (at least, not practically).

I am pretty sure I learned long division in public school no later than 3rd grade and as an adult I don’t think the local schools were anything to write home about. What an odd thing for you to brag about :slight_smile:

The issue is not whether there is an FPU or not, it is that the arithmetic is done using algorithms with the numbers in binary form regardless of the hardware. It is not done using the algorithm Montessori schools teach kids (or if it is, then yes, you should be bragging! :slight_smile: ) IIRC, Knuth is a good place to find the algorithms explained, and his tome has recently been republished and extended.

True celebrity sighting story: I was once at a conference, and in a session seated in the front row just in front of the speaker. To my immediate left was an old guy I didn’t recognize. He slept through most of it, then asked some bizarre-assed questions of the speaker at the end. It struck me as very unorthodox to say the least. As we were leaving, I noticed his name: Donald Knuth. I didn’t mind the unorthodoxy after that - I was in the presence of an academic legend.

As mentioned above, it doesn’t really matter whether the machine has an FPU or not. Sometimes when you’re dividing integers, you want the integer quotient and remainder (or maybe just one or the other). Sometimes instead you want the ratio of the two numbers as a “real” number – remembering of course that you’re getting floating-point numbers in most circumstances, not the full set of reals.

Applesoft BASIC on the Apple IIc (the particular machine you mentioned) didn’t provide a built-in operator for doing integer division. It’s division operator was always floating-point. If you really wanted the integer quotient, you could apply the built-in “INT” function to that ratio. Moreover, there was no “remainder” (or “modulus”) function at all, so if you wanted that value you had to derive it from the integer quotient and the original dividend.

(Applesoft’s predecessor, Integer BASIC, did provide integer division operators. But then all arithmetic in Integer BASIC was with integers – there was no floating-point support. And that’s more than you cared to know, I’m sure.)

As a point of interest - I’m not completely sure of this, but I think that a fair number of older hardware systems for calculators actually did the calculation in base 10. Don’t know why. But, of course, it would work, and it would eliminate the need for base conversion. Perhaps it is easier this way if you have very little RAM and quite a bit more ROM.

AFAIK all desktop computers did all their math in binary.

They don’t usually. That’s sometimes the point. You’re supposed to do it by hand, long division style. If they make you put the remainder, you have to do it mentally instead of ‘cheating’ and using a calculator.

I bet you were taught to put it as 45 R 3, but you don’t remember because it was used for about 6 months in the 3rd grade and never seen again. If not, how did you write the remainder?

Are you talking about mechanical devices or solid state/electronic devices? I am getting the sense you mean electronic, and fairly modern at that, because you talk about RAM and ROM.

So I am intrigued about how you think such electronic devices work? What would be the sense of building an electronic device that works in base 10 anyway, when it is infinitely easier (OK, hyperbole but not by much) to do it in base 2 (“binary”) and convert input and output as needed?

Is this a common belief? That computers work on the inside based on the number of fingers or toes we humans have?

Some early computers (like the IBM 1401) did their integer arithmetic in decimal, with one byte per digit. I don’t know why they did it that way.

Chessic Sense, as far as I remember, we didn’t use notation like “45 R 3.” As far as I remember, we would just give the answer as “45 with a remainder of 3.”