Skip to content

Commit

Permalink
Add float_compose to complement float_decompose
Browse files Browse the repository at this point in the history
This can be useful for example to make a generic canonical_NaN() function.
  • Loading branch information
Timmmm committed Oct 29, 2024
1 parent fe50754 commit b9d9e51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/float/common.sail
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ function float_decompose(op) = {
}
}

val float_compose : forall 'n, 'n in { 16, 32, 64, 128 }. float_bits('n) -> bits('n)
function float_compose(op) = op.sign @ op.exp @ op.mantissa

val not : forall ('p : Bool). bool('p) -> bool(not('p))
function not(b) = not_bool(b)

Expand Down

0 comments on commit b9d9e51

Please sign in to comment.