Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: supplementary S.I. units



In BASIC and FORTRAN programming languages, the "=" sign has two possible
uses; but a statement like "12=1" is meaningless and illegal and, with but
one exception, it's presence will crash execution. So even in the
computer programming venue, Donald's statement is accurate.

See appendix at end of message if interested in more details.

Of course no one is prevented from *creating* a context where the
statement "12=1" would have meaning; but it doesn't appear that anyone
has yet done so in the mainstream of math, science and data processing.

Best wishes,

Larry

------------------------------------------------------------
Larry Cartwright
Physics, Physical Science, Internet Teacher
Charlotte High School, 378 State Street, Charlotte MI 48813
<physics@scnc.cps.k12.mi.us> or <science@scnc.cps.k12.mi.us>
------------------------------------------------------------

PREVIOUS MESSAGES WERE:

From Donald E. Simanek:

To students, I'll usually say, "To write 12 = 1 is surely absurd.

From Herbert H Gottlieb:

I seem to recall that such statements are used in writing computer
programs in "BASIC"

From Karl Trappe:

Or n=n+1 to increment a variable (in Fortran?). Karl

From Ludwik Kowalski:

I agree with Karl: who wrote: "n=n+1 increments a variable"
(in Fortran, Basic and ...). This is another, totally different, use
of the same equality symbol.

-------------------------------------------------------------------------

APPENDIX: Two ways of using "=" in BASIC/FORTRAN programming language:

In the illustration "n=n+1", the "=" is a "replace" command. "n=n+1"
means "Create a new value by adding 1 to the current contents of the data
field named 'n', then *replace* the current contents of 'n' with this new
value." Like a lot of math (and physics) it first seems preposterous, but
eventually becomes comfortable and "natural" with repeated use.

The second use of the "=" is to request a "sameness" comparison. This can
be illustrated by the statement "if x=y then pause" which means "if the
contents of the data field named 'y' has a value precisely the same as the
data field named 'x', then pause execution of the program until further
instructed by the operator; otherwise, ignore this statement and move on
to the next." The language processor uses specific valuing and rounding
rules to interpret the fields and determine what "precisely the same"
means.

Both "=" interpretations can be used in the same statement: "if count=10
then count=0" means "if the current value of the data field named 'count'
is precisely 10, then replace the contents of 'count' with the value 0;
otherwise move on." (If "count" is restricted to incremented positive
integer content, this statement prevents its content from ever exceeding
one digit.)

Interestingly, since a "sameness" comparison or any other logical
comparison in an "if" command is not *required* to be true, most versions
of the language will accept "if 12=1 then pause". This statement will
never pause execution because the comparison "12=1" is, as Donald says,
"absurd" and its logical value is always "false". But since the overall
syntax of the "if statement" is correct, most versions of the language
won't crash execution.

Larry Cartwright
-------------------------------------------------------------------------