Skip to content

Commit

Permalink
Release 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
LeventErkok committed Jan 24, 2024
1 parent 49724ff commit b1d9975
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

* Latest Hackage released version: 3.5, 2023-04-11

### Version 3.6, 2024-01-24
* Be more clear when the provided input isn't a recognizable float,
instead of treating it as NaN implicitly. Thanks to Dmitry Blotsky for
pointing out the confusion.

### Version 3.5, 2024-01-11
* Resolve compilation issues with GHC 9.8 series

Expand Down
4 changes: 2 additions & 2 deletions crackNum.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Cabal-version : 2.2
Name : crackNum
Version : 3.5
Version : 3.6
Synopsis : Crack various integer and floating-point data formats
Description : Crack IEEE-754 float formats and arbitrary sized words and integers, showing the layout.
.
Expand All @@ -26,7 +26,7 @@ Executable crackNum
default-language: Haskell2010
hs-source-dirs : src
ghc-options : -Wall -Wunused-packages
build-depends : base >= 4.11 && < 5, libBF, sbv >= 10.0
build-depends : base >= 4.11 && < 5, libBF, sbv >= 10.3
, tasty, tasty-golden, filepath, directory, process
other-modules : Paths_crackNum, CrackNum.TestSuite
autogen-modules : Paths_crackNum
13 changes: 10 additions & 3 deletions src/CrackNum/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,19 @@ process num rm inp = case num of
note $ snd $ convert 11 53
_ -> ef (FP 11 53)
where p :: Double -> Predicate
p d = do x <- sDouble"ENCODED"
p d = do x <- sDouble "ENCODED"
pure $ x .=== literal d

ef (FP i j) = do let (v, mbS) = convert i j
print =<< satWith z3{crackNum=True} (p v)
note mbS
if bfIsNaN v
then die [ "Input does not represent floating point number we recognize."
, "Saw: " ++ inp
, ""
, "For decoding bit-strings, prefix them with 0x or 0b, and"
, "provide a hexadecimal or binary representation of the input."
]
else do print =<< satWith z3{crackNum=True} (p v)
note mbS
where p :: BigFloat -> Predicate
p bf = do let k = KFP i j
sx <- svNewVar k "ENCODED"
Expand Down

0 comments on commit b1d9975

Please sign in to comment.