You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: improvements to the floating-point API (#14481)
This PR improves the API surrounding `Float` / `Float.Model` / `Float32`
/ `Float32.Model` / `UnpackedFloat` in the following ways:
- The declarations `Float.nan` / `Float.inf` / `Float32.nan` /
`Float32.inf` and their corresponding models `Float.Model.nan` /
`Float.Model.inf` / `Float32.Model.nan` / `Float32.Model.inf` are added
(upstreamed from batteries, if you will).
- The abbreviations `Int.toFloat` and `Int.toFloat32` are added,
analogous to the existing `Nat.toFloat` and `Nat.toFloat32`.
- `Float.Model.Format` now requires `2 ≤ exponentBits` instead of just
`0 < exponentBits`; which is a necessary condition for `pack` and
`unpack` to behave correctly
- The definitions `Float.ofNat` / `Float.ofInt` / `Float32.ofNat` /
`Float32.ofInt` are now exposed.
- The type `Float.Model.UnpackedFloat.Sign` now has `deriving
DecidableEq` instead of just `deriving BEq`.
- The definitions for `unpackMantissa` / `unpackExponent` / `unpackSign`
now use `BitVec.extractLsb'` instead of `BitVec.extractLsb`
0 commit comments