fortran basic help 'd' operator [duplicate] - fortran

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
postfix 'd+0' in Fortran real literal expressions
I have this code line in Fortran 90:
OVERN2 = 1.d+0/DBLE(FLOAT(NMODE2))
NMODE2 is an integer, OVERN2 is a REAL*8.
Can you please explain to me what this line does? I don't understand the .d+0/ part?
if you can also translate that to C or any other easier language.

1.d+0 is just a double precision literal in scientific notation, i.e. 1.0e0 or just 1.0.
In C it would be:
double overn2 = 1.0 / (double)nmode2;

Related

what is the specific usecase for !! in C++ [duplicate]

This question already has answers here:
Double Negation in C++
(14 answers)
Closed 2 years ago.
Came across using !! in C++ during condition check
if ( !! (flag != 0 )){..
}
This could be directly used like
if( flag != 0 ){..
}
Is there any specific corner use case in C/C++ or is it just a form of coding style ?
In this case, it's superfluous, but in general this style is used to convert the actual expression value to
an integer type in C.
a boolean type in C++.

What is the use of // operator in Python and when is it advisable? [duplicate]

This question already has answers here:
What is the difference between '/' and '//' when used for division?
(16 answers)
Closed 6 years ago.
How is it different than "/"?
I tried print 10//5 and print 10/5 and both gave the same result.
Try:
print 10.0/6
print 10.0//6
The first is regular division, which results in a floating-point number, whereas the latter is integer division, which truncates the decimal part.

Livecode Strict isNumber() needed [duplicate]

This question already has answers here:
regular expression: a line of string contains only float numbers and tab/spaces
(3 answers)
Parsing scientific notation sensibly?
(4 answers)
Closed 7 years ago.
Livecode's isNumber returns true when certain text strings are used. isNumber("one") returns true. I need a "strict" isNumber function where any strings would return false. Needs to handle +/-, integers, reals, e notation preferably. I'm looking for a PCRE regex for matchText(pValue, regexHere)

DATA declaration in Fortran [duplicate]

This question already has an answer here:
what does DATA TKX/2HKX/ mean in fortran?
(1 answer)
Closed 1 year ago.
Does anyone know the meaning of 4HEND in the following line which comes from an old Fortran code?
DATA XHEND / 4HEND /
4HEND is a Hollerith code to represent the character string "END ". In very old FORTRAN, the variable XHEND might even be a 4-byte integer or real used to hold character data. If implicit typing was in effect in this program, XHEND would have been a real. Another recent question with Hollerith codes: Writing both characters and digits in an array
It replaces assignment
XHEND='END '

Trailing u in Hex Number C/C++ [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Meaning of U suffix
I'm going through code that has a bunch of defines that look like:
#define HEX_NUMBER (0x000000FFu)
What is the trailing u? I've tried compiling with and without it and I don't see any difference.
Appending u to any integral constant makes the compiler interpret it as unsigned.