Browse Source

Bug fix: stop a floating point exception (if enabled) (found by Christian von Essen).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@4175 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 14 years ago
parent
commit
0ae0b36ebe
  1. 18
      cudd/cudd/cuddTable.c

18
cudd/cudd/cuddTable.c

@ -1466,13 +1466,17 @@ cuddUniqueConst(
// this is the new version...
// (round off before doing hash function to ensure
// close valued constants are in the same table)
trunc = 10000000000.0; // 10^10
m = value * trunc;
n = floor(m);
if (m-n >= 0.5)
n = n + 1;
n = n / trunc;
split.value = n;
if (isfinite(value)) {
trunc = 10000000000.0; // 10^10
m = value * trunc;
n = floor(m);
if (m-n >= 0.5)
n = n + 1;
n = n / trunc;
split.value = n;
} else {
split.value = value;
}
pos = ddHash(split.bits[0], split.bits[1], unique->constants.shift);
nodelist = unique->constants.nodelist;

Loading…
Cancel
Save