-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow
:exhaust
to work directly on floating-point values
by enumerating all bitpatterns. Note, this overcounts somewhat the number of distinct floating point values there are, since all NaNs are considered identical as `Float` values. We could be more careful here to avoid generating more NaN values than required, but I'm not sure it's worth the effort. Fixes #1051
- Loading branch information
1 parent
38a9c58
commit b413294
Showing
3 changed files
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
:m Float | ||
:exhaust (\x -> (y != y \/ x == fpToBits y where y = fpFromBits x : Float16)) | ||
:exhaust (\x -> (x : Float16) =.= fpFromBits (fpToBits x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters