|
Post by PhantomWolf on Sept 18, 2007 18:15:15 GMT -4
"It's true then, what they say. The Evil One does eat babies!" Are you calling the Doctor evil? Heresy!!
|
|
|
Post by tardis on Sept 18, 2007 18:24:04 GMT -4
In Fortran the exponentiation operator is **. So 3.3 to the fifth power is written 3.3**5. The "e" notation (or "d" for double-precision) is for real-valued literals in the way we've been using it here and with IDW. In Fortran 3.3e+5 means "a real number having the value 3.3 times ten to the 5th power." Some Fortran dialects do not require the explicit sign on the exponent. You've making me remember Fortran (and it's making my brain hurt). My books have long since gone the way of used book stores, but wans't there a subop "format E" or "E format" that used "e" as the indicator of an exponent? Or has dabbling briefly in COBOL in my youth caused irreversible damage? If I'm remembering incorrectly, my apologies and IDW loses yet another possible straw to grasp at. Heading for the aspirin bottle......
|
|
|
Post by JayUtah on Sept 18, 2007 18:48:48 GMT -4
No, the E format directive still applies only to scientific notation and not to general exponentiation. This distinction is scrupulously maintained specifically to avoid confusing the two, which makes IDW's handwaving all the more futile. General algebraic exponentiation has exactly one representation in Fortran: **. Embedded "e" refers only to scientific notation, with the implied base of 10.
|
|
|
Post by Tanalia on Sept 18, 2007 18:51:30 GMT -4
The format Jay specified is the only form I ever encountered in over a decade of working with Fortran. You may be thinking of the use of 'E' (or 'e', since case doesn't matter outside string values) as a format specifier for conversion between internal REAL (floating point) format and human-readable strings.
eta: Even in those cases, the number appears using the same notation as you enter it into the program, such as 3.3E+05
|
|
|
Post by JayUtah on Sept 18, 2007 19:14:42 GMT -4
There is a format specifier Ea.b for the FORMAT statement in Fortran. It works essentially like F in terms of length and decimal pointing in the input record, but accepts input with embedded E to separate the mantissa from the exponent. The string "33E5" in the input record can be parsed with READ using a FORMAT specifier of "E4.1", interpreted "A four-character input field in scientific notation in which there is one decimal place in the mantissa."
|
|
|
Post by tardis on Sept 18, 2007 19:29:56 GMT -4
Thank you, gentlemen. I stand corrected. I can only plead my aged condition and the aforementioned brief flirt with COBOL (shudder).
And Jason, if you *are* referring to the Doctor as "the Evil One", don't be surprised if nobody rescues you from the Daleks.
ETA: And that'll teach me--"Google first, prior to putting foot in mouth and not *after* being corrected."
|
|
|
Post by Count Zero on Sept 18, 2007 21:05:33 GMT -4
Naw - Around here, correction is just part of the learning process.Some boards (and posters) don't have a learning process. Welcome, Tardis!
|
|
|
Post by JayUtah on Sept 18, 2007 21:23:53 GMT -4
If Fortran rots your brain, COBOL stomps it into a fine white paste. Sigh - if only Fortran experience were limited to the distant past from whence it arose. Unfortunately there is still a market for Fortran.
|
|
|
Post by tardis on Sept 18, 2007 22:03:40 GMT -4
Thanks, Count! I'm always ready to learn.
Jay, that kind of surprised me. After you and Tanalia pointed out where I was wrong, I did some googling and was shocked to see Fortran still alive and well. Even more shocked when I browsed my Suse 9.3 with Yast and found...Fortran. Well, sort of; it's actually a Fortran-77 to C compiler.
And I've always believed Dijkstra's comment--"The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense." The man knew what he was talking about.
|
|
Jason
Pluto
May all your hits be crits
Posts: 5,579
|
Post by Jason on Sept 18, 2007 22:35:12 GMT -4
"It's true then, what they say. The Evil One does eat babies!" Are you calling the Doctor evil? Heresy!! Actually I was quoting Leela (who thought the Doctor was the Evil One when she first met him, an understandable mistake, since the Doctor had the same face as the giant stone carving of the Evil One on her planet: en.wikipedia.org/wiki/Image:Faceofevil.jpg). Her's was the best answer ever to the question "would you like a jellybaby?"
|
|
|
Post by Joe Durnavich on Sept 18, 2007 22:40:53 GMT -4
I don't think COBOL damages the mind. Why, I've been working with COBOL programs for the past 24 years and my mind hasn't....oh, never mind, I see your point.
Dijkstra, I suppose, was speaking of the COBOL of that era, which lacked many of the constructs available today that allow (somewhat) structured programming. It is, however, difficult to reuse code in COBOL, which means the programming staff tends to copy and paste code that would be in a shareable function, library, or object in a modern language.
I think that the more serious problems that cause hair to go gray arise not so much because of the language used, but because of the engineering--or lack of it--behind it. There are practices in software development that appear benign at first, but develop into nightmares when the app grows to many thousands of programs and many millions of lines of code. I suspect that many of these problems can be avoided in both COBOL and Fortran.
In other words, perhaps we programmers may be more to blame than the language!
|
|
|
Post by PhantomWolf on Sept 18, 2007 23:05:07 GMT -4
Are you calling the Doctor evil? Heresy!! Actually I was quoting Leela (who thought the Doctor was the Evil One when she first met him, an understandable mistake, since the Doctor had the same face as the giant stone carving of the Evil One on her planet: en.wikipedia.org/wiki/Image:Faceofevil.jpg). Her's was the best answer ever to the question "would you like a jellybaby?" Would it age me if I admited that now you mention it, I remember watching this episode? One thing that is missing in the new series, he doesn't seem to carry that never ending supply with him.
|
|
|
Post by JayUtah on Sept 18, 2007 23:28:03 GMT -4
The best Fortran compilers for Linux are commercial. Pathscale makes a good one. The Fortran 90 standard is a usable language. As with old COBOL, there is a dialect that I call "Evil Fortran" which includes some features removed in the 1990s. One of them was the infamous three-way conditional.
There is a great degree of legacy code in Fortran, used in complex science in life-safe engineering applications. It has been debugged at great expense and effort. But there are also applications and algorithms that are simply easier and better programmed in Fortran.
There is also a great deal of legacy code in COBOL. COBOL is to the financial world what Fortran is to the engineering world. Both languages have evolved over the decades to become credible among younger peer languages.
A good programmer can make the best use of any language and find acceptable remedies for the language's shortfalls. Similarly, a language that keeps bad programmers from doing foolish things is not powerful enough to be of any practical use.
The reasons why bad code exists are many, and I can speak at great length (even for me) on the subject. So I won't now. But I don't disagree that much fault lies with programmers themselves.
|
|
Al Johnston
"Cheer up!" they said, "It could be worse!" So I did, and it was.
Posts: 1,453
|
Post by Al Johnston on Sept 19, 2007 6:32:18 GMT -4
One thing that is missing in the new series, he doesn't seem to carry that never ending supply with him. It was pretty much a Tom Baker thing. Peter Davison might have done it once or twice, but I don't recall any others.
|
|
|
Post by sts60 on Sept 19, 2007 9:25:58 GMT -4
I don't think COBOL damages the mind. Why, I've been working with COBOL programs for the past 24 years ... Look, Joe, you're among friends, so if you need to admit this, well, we're here for you. But don't brag of it. There's such a thing as pushing friendship too far.
|
|