You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library offers a Fortran binding to the GNU MPFR
Library multi-precision library. The aim of
the library is to make the use of MPFR convenient for a Fortran user.
Status
This is an initial work, expect bugs and (especially) missing features
and possibly some instability, at least in binary compatibility.
Source code compatibility should be fine.
Compiler requirements
As of now, you need a compiler which supports `ERROR STOP for the
testsuite.
What is supported
Arithmetic expressions can be used the usual way; expressions
can be mixed with real and integer expressions.
Mathematical intrinsics, like sin, cos etc.
Array expressions
Setting and changing a default precision of variables
List-directed output
Reading values from strings
What is not supported
Input (user-defined I/O is too unevenly implemented in existing
compilers)
Array intrinsics like MAXLOC and MAXVAL
An example
Here is a short exampe, if your compiler supports user-defined I/O:
program memain
use fmpfr_oper
implicit none
type (fmpfr), dimension(:), allocatable :: a
call set_default_prec (128)
allocate (a(2))
a(1) = fmpfr("1.3")
a(2) = a(1) + 2
print *,a
print *,sin(a)
print *,get_str(cos(a(1)),10)
end program memain