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:
parent
fc4beee0b6
commit
cd3e8d8741
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue