Re: large number with interger
- From: Tobias Burnus <burnus@xxxxxxxx>
- Date: Tue, 29 Jan 2008 06:16:22 -0800 (PST)
On Jan 25, 7:11 pm, Kith <kiths...@xxxxxxxxx> wrote:
I have a problem to deal with a large number with interger. The
problem is I have to deal with integers of about 20 digits. I am using
Fortran Professional version (2001). Currently, I am using
integer(8) command but it takes only 12 digits. I would appreciate if
someone could help me with this.
Some compilers might support INTEGER(16) (16 byte integers).
I actually thought that several compilers do so, but I just saw that
of my compiler seemingly only gfortran does so (on x86-64-linux; I
tried in total 6 compilers).
In any case with gfortran one can do "INTEGER(16) :: i", which allows
numbers up to
huge(1_16) = 170141183460469231731687303715884105727
which allows for selected_int_kind(38) and is thus enough for your 20
digit numbers.
This solution might be the easiest. Otherwise, one could use one of
the several multi precision libraries as proposed before.
GNU Fortran (gfortran) is available for almost all platforms, is Open
Source and thus free and can be downloaded, e.g., from
http://gcc.gnu.org/wiki/GFortranBinaries
Tobias
.
- References:
- large number with interger
- From: Kith
- large number with interger
- Prev by Date: Re: What is wrong with this search for the character PV/PQ
- Next by Date: Fortran 6.5 Download
- Previous by thread: Re: large number with interger
- Next by thread: it links, but why does it return 0??
- Index(es):
Relevant Pages
|
|