## Precision

## Precision

(OP)

hi everybody,

I am using f 77 and i want to use more than 14 decimal places (more than double precision). I would be glad if you could help me in this manner. thanks in advance, have a nice day.

I am using f 77 and i want to use more than 14 decimal places (more than double precision). I would be glad if you could help me in this manner. thanks in advance, have a nice day.

## RE: Precision

http://en.wikipedia.org/wiki/Double_precision

see:

http

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

## RE: Precision

## RE: Precision

## RE: Precision

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

## RE: Precision

http://d

then there is a page on NAG's website that talks about using quadruple precision in F77:

http

## RE: Precision

NAG FORTRAN 77 EXTENSIONS

and that only double precision is listed as a "standard data type"

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

## RE: Precision

What type of application do you need the extra precision for? Many times... the extended precision is not really warranted. Often, all you need is a slightly better algorithm.

Dan

## RE: Precision

## RE: Precision

If he wants fast executing code, using a data type that is native to the computer he is using is generally a better choice than to use a software implemented extended precision data type (slower calculations and a higher likelihood of bugs in the extended precision algorithm itself). Keep in mind... most people on this forum probably think of Double Precision as giving up to about 16 digits of precision. Though that may be true for Intel computers, it's not true of all others. Some computers have over 30 digits of precision with their Double Precision variables.

If he is building a large code and/or a code that he intends to use well into the future, keeping it "standard conforming" with the fortran language as much as possible is ALWAYS a good choice. Any time you move away from the language Standard, you risk having more maintenance headaches in the future. I generally conclude that the algorithm that can give the desired results using the least precision data type is the better solution. This may not ALWAYS be true, however, I'm pretty sure it is true most of the time.

In any case... whether or not to use an extended precision data type should be considered carefully when writing a code that you want to continue to use into the future.

Dan

www.dtware.com

## RE: Precision

as a simple example:

10^9* (0.123456789-0.123456788)

if you have 9 digits precision the result is 1, if you have a precision less than 9 the result is 0.

I guess i should switch to C which has big number option. thanks a lot for your valuable comments.

## RE: Precision

## RE: Precision

Something doesn't seem quite right. All Fortran compilers should allow you to declare Double Precision variables anytime you want to. If they don't, they simply aren't valid fortran compilers. And, if you are on a Windows computer, then... it is pretty much a given that your compilers idea of double precision is probably an 8-byte Real number. That will generally mean 15-16 digits of precision. My guess is that there is something in your code which is not quite right. You might want to consider posting the part of your code that declares the variables for the math you are referring to in your prior post. Also... exactly which compiler are you using?

Dan

www.dtware.com

## RE: Precision

Dan, you are right, instead of quad precision i wrote double precison and i am sure that my compiler is not supporting quad precision. i am using absoft pro fortran 7.5, and according to technical support people if i want to use quad precision, i need to upgrade my compiler and i dont want to upgrade. is there any free compiler that supports quad precision.

## RE: Precision