Re: busting sp datatypes
- From: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Aug 2008 20:34:34 -0500
In article <1ekmpg9sbb6l6.dlg@xxxxxxxxxxxxxxx>,
Ron Ford <ron@xxxxxxxxxxxxxxx> wrote:
Don't I need to wrtie an executable staement to figure this out, such as:
mp =selected_int_kind(13)
If I execute a statement, I can't thereafter declare:
integer (kind=mp) :: anything
Does anyone know a portable way to declare, populate and print an integer
with thirteen digits?
I don't understand the above sequence of sentences.
selected_int_kind(13) does what you want in a portable way, provided
the compiler supports an integer that long. If your compiler does
not support integers with 13 digits, then what you want to do is not
portable to that compiler.
integer, parameter :: i13 = selected_int_kind(13)
integer(i13) ::long_int_with_at_least_13_digits
long_int_with_at_least_13_digits = 1234567890123_i13
write(*,'(i14)') long_int_with_at_least_13_digits
Of course, you are free to change the variable names. If your
compiler does not support 13 digit integers, then the above results
in an error at compile time, not run time.
$.02 -Ron Shepard
.
- References:
- Re: busting sp datatypes
- From: glen herrmannsfeldt
- Re: busting sp datatypes
- From: wim
- Re: busting sp datatypes
- From: Ron Ford
- Re: busting sp datatypes
- Prev by Date: Re: novice needs help
- Next by Date: Re: busting sp datatypes
- Previous by thread: Re: busting sp datatypes
- Next by thread: Re: busting sp datatypes
- Index(es):
Relevant Pages
|