Alex Rivera | Logout

How to use and verify quad precision in gfortran?

Asked 2012-07-09T16:22:55.880
12

I am trying to use quad precision in gfortran, but it seems like the real*16 does not work. After some fishing around, I have found that it may be implemented as real*10. Is real*10 actually quad precision?

How can I test the precision of my code? Is there a standard simple algorithm for testing precision? For example, when I want to figure out what computer zero is, I continue to divide by 2.0 until I reach 0.0. Keeping track of the values lets me know when the computer 'thinks' that my non-zero number is zero - giving me computer zero.

Is there a good way of figuring out the precision with a type of algorithm like I described?

Edit
Report

1 Answer

2

The gfortran documentation for kind type parameters answers this question, in particular the last sentence, which reads:

The available kind parameters can be found in the constant arrays CHARACTER_KINDS, INTEGER_KINDS, LOGICAL_KINDS and REAL_KINDS in the ISO_FORTRAN_ENV module (see ISO_FORTRAN_ENV).

What you may have discovered is that real*16 is not implemented on your platform.

answered 2012-07-09T16:31:41.473

Your Answer