View previous topic :: View next topic |
Author |
Message |
sparge
Joined: 11 Apr 2005 Posts: 371
|
Posted: Fri Oct 06, 2006 7:23 am Post subject: KIND & SELLECTED_INT_KIND |
|
|
At the risk of asking a stupid question ... as I upgrade code from "FTN77" to "FTN95", I occasionally get the following output during compilation:
comment 981 - Specifying the kind of the type INTEGER with the constant '2' is non-portable - 'SELECTED_INT_KIND(4)' would be better
I understand what the comment means. However, the suggested portable solution does not seem correct to me. As I understand it:
* kind = 2 implies 2 bytes of storage i.e integers between -32760ish and +32760ish (can never remember which end gets the extra non-zero value)
* selected int_kind (4) implies integers between -10^4 and +10^4 i.e between -9999 and +9999
I accept that the two can not be mapped exactly onto each other, but I think selected_int_kind (5) is the correct portable solution. What is incorrect: the compiler comment, or my understanding?
Andy |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Oct 06, 2006 10:02 am Post subject: KIND & SELLECTED_INT_KIND |
|
|
Andy
selected_int_kind(5) = 3.
You need INTEGER*4 for to store 99999.
selected_int_kind (n) = 2 for n = 3 or 4. |
|
Back to top |
|
 |
|