next up previous
Next: Writing a New Model Up: Running the Program With Previous: Choosing Run Parameters

Double Precision

By default LATTICEEASY uses single precision. While precision is technically compiler-dependent, most compilers use four bytes for a single precision real number, which typically corresponds to about seven or eight digits of precision. Our experience is that this is adequate for most physical problems, but sometimes you need more precision. This can happen, for example, if you are initializing one or more fields with a large homogeneous value and very small initial fluctuations. With single precision $1 + 10^{-10}$ will simply evaluate to $1$, so to keep track of such small fluctuations you will need to use double precision.

To do a run with double precision simply insert
#define float double
into the files latticeeasy.h and ffteasy.cpp, just below the list of headers. This will cause the compiler to interpret the word ``float'' as if it were the word ``double'' throughout the program.

Using double precision generally has little or no cost in speed. The disadvantage is that it requires twice as much memory as a single precision run.

Go to The LATTICEEASY Home Page
Go to Gary Felder's Home Page
Send email to Gary Felder at
Send email to Igor Tkachev at

This documentation was generated on 2008-01-21