How to bignum in Fortran

265 Views Asked by At

For a language designed for scientific computing---even 50ish years ago, I am surprised to find that Fortran 2018 didn't have a native type for bignum or bigInt types for arbitrary precision, and suspect I am doing something wrong. What is the standard process for this?

I'm thinking:

program toosmall
  ! compile with:
  ! gfortran -fno-range-check -o toosmall toosmall.f90 

  implicit none

  integer :: base, pow, res

  base = 1000
  pow  = 100000

  res= base**pow

  print *,res

end program toosmall

And this produces

$ ./toosmall 
           0
0

There are 0 best solutions below