Mathematical expression syntax (was: C vs. Fortran)

Mike Coffin mike at arizona.edu
Fri Jul 1 09:43:18 AEST 1988


>From article <20509 at beta.lanl.gov>, by jlg at beta.lanl.gov (Jim Giles):
> Mathematics texts don't have flow control problems to deal with.  As
> a result, they never invented a standardized syntax for it.  The parts
> of Fortran which represent scalar mathematical expressions do a
> creditable job of keeping to traditional mathematical syntax.

Hmmm.  Plus, minus, divide, and parenthesis are used in pretty much
the same way.  In traditional mathematics, multiplication is usually
represented by adjacency (sometimes a dot or a cross), square roots by
a root sign, absolute values by vertical bars, complex numbers as in
(3+4i), inequalties by < and > (not .LT.  and .GT.), ... the list
could be extended indefinitely.  And at least one symbol, =, is used
in a decidedly nontraditional way. (Can you imagine Gauss or Euler
uttering "a = a + 1"?).

I'm not saying this is all bad.  In fact, you hit the nail on the
head: mathematics texts don't have to deal with flow control, while
programming languages (at least imperative ones) deal with almost
nothing else.   There has never been a standard way to present
algorithms; often they end up as numbered steps interspersed with
natural-language instructions.




-- 

Mike Coffin				mike at arizona.edu
Univ. of Ariz. Dept. of Comp. Sci.	{allegra,cmcl2,ihnp4}!arizona!mike
Tucson, AZ  85721			(602)621-4252



More information about the Comp.lang.c mailing list