Replaced a naked floating point equality check with a fuzzy check.

This was causing problems in the optimized, DEBUG_MODE code.
This commit is contained in:
Harry Moffat 2008-03-31 23:51:41 +00:00
parent fc4beee0b6
commit cd3e8d8741

View file

@ -948,7 +948,8 @@ namespace VCSnonideal {
* This should keep the amount of material constant.
*/
#ifdef DEBUG_MODE
if (ds[kspec] != dx) {
if (fabs(ds[kspec] -dx) > 1.0E-14*(fabs(ds[kspec]) + fabs(dx) + 1.0E-32)) {
plogf(" ds[kspec] = %20.16g dx = %20.16g , kspec = %d\n", ds[kspec], dx, kspec);
plogf("we have a problem!\n");
exit(-1);
}