Skip to content

Commit

Permalink
leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dddejan committed May 23, 2016
1 parent cb359d9 commit bd7cdd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/number/dyadic_rational.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ int dyadic_rational_get_distance_size(const lp_dyadic_rational_t* lower, const l
integer_construct(&diff);
integer_sub(lp_Z, &diff, &upper->a, &lower->a);
size = integer_log2_abs(&diff);
integer_destruct(&diff);
size -= lower->n;
integer_destruct(&diff);
} else if (lower->n > upper->n) {
// n1 > n2
// size([l/2^n1, u/2^n2]) = log2( u*2^(n1 - n2) - l) / 2^n1)
Expand All @@ -347,6 +347,7 @@ int dyadic_rational_get_distance_size(const lp_dyadic_rational_t* lower, const l
integer_sub(lp_Z, &diff, &diff, &lower->a);
size = integer_log2_abs(&diff);
size -= lower->n;
integer_destruct(&diff);
} else {
// n1 < n2
// size([l/2^n1, u/2^n2]) = log2( u - l*2^(n2 - n1)) / 2^n2)
Expand All @@ -356,6 +357,7 @@ int dyadic_rational_get_distance_size(const lp_dyadic_rational_t* lower, const l
integer_sub(lp_Z, &diff, &upper->a, &diff);
size = integer_log2_abs(&diff);
size -= upper->n;
integer_destruct(&diff);
}

return size;
Expand Down

0 comments on commit bd7cdd6

Please sign in to comment.