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 will simply evaluate to , 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.