Skip to content

Commit bdd48ec

Browse files
committed
exp(´0.0) evaluates to 1.0 now
1 parent 7d8fbfd commit bdd48ec

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

changelog.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ Date: ?-?-?
6868
[DESCRIPTION]
6969
New stuff!
7070

71+
[ENTRY]
72+
Module: minimodel
73+
What: bug
74+
Rank: minor
75+
Thanks: Conrad Drescher
76+
[DESCRIPTION]
77+
exp(0.0) now correctly evaluates to 1.0 (and not 0.0).
78+
7179
[ENTRY]
7280
Module: int
7381
What: changed

gecode/minimodel/float-arith.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,10 @@ namespace Gecode { namespace MiniModel {
226226
{
227227
assert(n == 1);
228228
FloatVar x = a[0].post(home);
229-
if (x.assigned() && (x.val() == 0.0))
230-
y = result(home,ret,x);
231-
else {
229+
if (x.assigned() && (x.val() == 0.0)) {
230+
FloatVar one(home,1.0,1.0);
231+
y = result(home,ret,one);
232+
} else {
232233
y = result(home,ret);
233234
exp(home, x, y);
234235
}

0 commit comments

Comments
 (0)