xtifiq
Last Updated: February 25, 2016
·
595
· skopp
74c714225754481aabee8ab22408cd2d

Info Byte: FORTRAN & DATA

The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793... at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant.

This also simplifies modifying the program, should the value of pi change.

FORTRAN manual for Xerox Computers

Say Thanks
Respond

4 Responses
Add your response

4268
0076809434a32c54b5b0971b184ca113

Thanks for the bit :)
Isn't the same accomplished with PARAMETER statement?
Or does it have some advantages to it?

over 1 year ago ·
4294
74c714225754481aabee8ab22408cd2d

Good question. I think you may well be right. FORTRAN is not really my...uh, forte :)
I think this is from the editions of the language around '77', '66' or one or two before it. I'm not sure why, but it would appear that the "DATA" statement is obsolete (http://goo.gl/I9ISp), I'm guessing the PARM statement is of its successors.

See also (http://goo.gl/gaTPj)

over 1 year ago ·
4328
0076809434a32c54b5b0971b184ca113

Yup, it's obsolete alright.
F90 didn't have it actually removed, rather marked as "obsolescent", meaning it for future removal.

over 1 year ago ·
4332
74c714225754481aabee8ab22408cd2d

Cool. I just find the history of computing, logic systems and computer systems in general quite interesting.

I read also that 'FORTRAN' is now stylized as simply 'Fortran' - but you probably knew that I presume. If not, another 'info byte' for you there ;)

over 1 year ago ·