Skip to content

Commit

Permalink
feat: expose float to ieee-754 bv conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
KpwnZ committed Nov 7, 2024
1 parent ea9df51 commit 018e963
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions z3/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,16 @@ impl<'ctx> Float<'ctx> {
Self::round_towards_zero(self.ctx).div(self, other)
}

// Convert to IEEE-754 bit-vector
pub fn to_ieee_bv(&self) -> BV<'ctx> {
unsafe {
BV::wrap(
self.ctx,
Z3_mk_fpa_to_ieee_bv(self.ctx.z3_ctx, self.z3_ast),
)
}
}

unop! {
unary_abs(Z3_mk_fpa_abs, Self);
unary_neg(Z3_mk_fpa_neg, Self);
Expand Down

0 comments on commit 018e963

Please sign in to comment.