I'm unable to interpret a sentence though searched and read multiple explanations.
“GOD is real, unless declared integer.” a Fortran-based witticism
Real is real number,
What's the idioms it refers to ?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.
Sign up to join this communityI'm unable to interpret a sentence though searched and read multiple explanations.
“GOD is real, unless declared integer.” a Fortran-based witticism
Real is real number,
What's the idioms it refers to ?
This has little to do with English language and usage: it is entirely to do with the conventions of Fortran, a computer programming language.
Fortran has two kinds of variables: Integer variables (that hold an integer number) and real variables (that hold a real number).
By default, any variable whose name begins with the letters I,J,K,L,M or N is integer, otherwise it is real. So a variable called GOD would by default be a "real variable" - in short, "GOD is real".
The joke is that this might be presented as an argument for the existence of God.
In computer programming, a value has a type. Two kinds of numeric types are real and integer.
Integers are only whole numbers. Reals are numbers with exponents and fractional parts (parts after a decimal point) accurate to a certain precision, so you can store, say, 3.1415926.
None of the above is specific to Fortran. What is specific to Fortran is that numeric variables can be real or integer, with real being the default, unless specifically declared to be integer (see also other answer about variables beginning with I,J,K,L,M or N defaulting to integer).
Previous answers, though good, are not clear enough about types and declaration, in my humble opinion.
Most programming languages allow (or require) you to say, at the top of each program or subroutine, what variables you are going to use and what kind of data they will hold. The most common types are boolean (one bit), integer, real (now more usually called floating point), complex, character, string. Type matters because the same sequence of bits can be interpreted in all of these different ways, and thus represent different values.
When Fortran finds a sequence of characters (beginning with a letter) that is neither a reserved word (like IF) nor a declared variable, it will treat that string as the name of a variable, assigning it type INTEGER or REAL according to the first letter. Variables beginning with I through N are integers by default because these letters are conventionally preferred for use as indices to sequences: xk means the kth entry in sequence x.
(Fortran has a command, which I've forgotten, to change the defaults; if you're using a lot of COMPLEX variables, you might assign them the letters C,W,Z, which would otherwise default to REAL.)
So. If the command INTEGER GOD appears near the top, then the label GOD is assigned to a variable whose content will be processed as an integer; if not, and the word GOD appears elsewhere in the code, then the label GOD is assigned to a variable whose content will be processed as a floating-point number.
The joke also plays on the 1886 statement attributed to mathematician Leopold Kronecker:
God made the integers, all else is the work of man.