Should I convert FORTRAN code to C?

Frank Swarbrick swarbric at tramp.Colorado.EDU
Thu Jun 9 16:45:19 AEST 1988


(I am really wondering if this belongs in comp.lang.fortran at all, but I am
not sure if Jerry Berkman reads comp.lang.c.  Sorry.)

Anyway, just because your outdated compiler doesn't compile x = +5 means only
that your compiler is outdated...  Or maybe even buggy, as it should not really
think it means x =+ 5.  And indeed, it doesn't, as it gave you a syntax error
instead of a warning saying you never initialized x.  Or maybe C used to not
accept this format; I don't know.

Anyway, I'm not disagreeing that it's good that FORTRAN can generate differnt
things for x = abs(x) depending on whether or not x is float, int, or whatever.
It's just in C the compiler does not know what a function looks like.  They
are just black boxes with a few restrictions.  C was made this way for a
reason, and I like it.  FORTRAN is different for a reason, and that's fine
too.

(Oh, by the way, if x is float or double use x = fabs(x);)

Frank Swarbrick (and, yes, the net.cat)           swarbric at tramp.Colorado.EDU
...!{ncar|nbires}!boulder!tramp!swarbric
"...This spells out freedom, it means nothing to me, as long as there's a PMRC"



More information about the Comp.lang.c mailing list