3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00

Bugfix for fp.isSubnormal.

Fixes #10
This commit is contained in:
Christoph M. Wintersteiger 2015-03-29 13:31:44 +01:00
parent 4bfe20647b
commit 690eb8eaca
2 changed files with 8 additions and 3 deletions

View file

@ -2952,11 +2952,16 @@ void fpa2bv_converter::mk_is_pzero(expr * e, expr_ref & result) {
}
void fpa2bv_converter::mk_is_denormal(expr * e, expr_ref & result) {
expr * sgn, * sig, * exp;
expr * sgn, *sig, *exp;
split_fp(e, sgn, exp, sig);
expr_ref zero(m);
expr_ref zero(m), zexp(m), is_zero(m), n_is_zero(m);
zero = m_bv_util.mk_numeral(0, m_bv_util.get_bv_size(exp));
m_simp.mk_eq(exp, zero, result);
m_simp.mk_eq(exp, zero, zexp);
mk_is_zero(e, is_zero);
m_simp.mk_not(is_zero, n_is_zero);
m_simp.mk_and(n_is_zero, zexp, result);
}
void fpa2bv_converter::mk_is_normal(expr * e, expr_ref & result) {

View file

@ -1350,7 +1350,7 @@ bool mpf_manager::is_ninf(mpf const & x) {
}
bool mpf_manager::is_normal(mpf const & x) {
return !has_bot_exp(x) && !has_top_exp(x);
return !is_zero(x) && has_bot_exp(x);
}
bool mpf_manager::is_denormal(mpf const & x) {