[gmx-users] template.c

Tsjerk Wassenaar tsjerkw at gmail.com
Sun May 30 20:02:08 CEST 2010

Hi Chandan,

The problem is that with floating points the equality in

>  if (fr.time == (4000.000 + (50.0 * inc)))

is very unlikely to be satisfied at any time. To compare floating
point numbers, you'll have to check whether the value is within a
certain interval. But Jussi's approach is far more convenient in this
particular case.



Tsjerk A. Wassenaar, Ph.D.

post-doctoral researcher
Molecular Dynamics Group
Groningen Institute for Biomolecular Research and Biotechnology
University of Groningen
The Netherlands

More information about the gromacs.org_gmx-users mailing list