packages feed

crackNum 1.3 → 1.4

raw patch · 8 files changed

+73/−32 lines, 8 filesdep ~data-binary-ieee754setup-changedPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: data-binary-ieee754

API changes (from Hackage documentation)

- Data.Numbers.CrackNum: bias :: FP -> Int
- Data.Numbers.CrackNum: bitLayOut :: FP -> String
- Data.Numbers.CrackNum: expt :: FP -> Int
- Data.Numbers.CrackNum: fracBits :: FP -> [Bool]
- Data.Numbers.CrackNum: instance Show FP
- Data.Numbers.CrackNum: intVal :: FP -> Integer
- Data.Numbers.CrackNum: kind :: FP -> Kind
- Data.Numbers.CrackNum: prec :: FP -> Precision
- Data.Numbers.CrackNum: sign :: FP -> Bool
- Data.Numbers.CrackNum: stExpt :: FP -> Int
+ Data.Numbers.CrackNum: [bias] :: FP -> Int
+ Data.Numbers.CrackNum: [bitLayOut] :: FP -> String
+ Data.Numbers.CrackNum: [expt] :: FP -> Int
+ Data.Numbers.CrackNum: [fracBits] :: FP -> [Bool]
+ Data.Numbers.CrackNum: [intVal] :: FP -> Integer
+ Data.Numbers.CrackNum: [kind] :: FP -> Kind
+ Data.Numbers.CrackNum: [prec] :: FP -> Precision
+ Data.Numbers.CrackNum: [sign] :: FP -> Bool
+ Data.Numbers.CrackNum: [stExpt] :: FP -> Int
+ Data.Numbers.CrackNum: instance GHC.Show.Show Data.Numbers.CrackNum.Data.FP

Files

CHANGES.md view
@@ -1,7 +1,11 @@ * Hackage: <http://hackage.haskell.org/package/crackNum> * GitHub:  <http://github.com/LeventErkok/crackNum/> -* Latest Hackage released version: 1.3, 2015-04-11+* Latest Hackage released version: 1.4, 2016-01-17++### Version 1.4, 2016-01-17+  * Fix NaN nomenclature: Screaming->Signaling+  * Add an example to README.md  ### Version 1.3, 2015-04-11   
@@ -1,4 +1,4 @@-Copyright (c) 2015, Levent Erkok (erkokl@gmail.com)+Copyright (c) 2015-2016, Levent Erkok (erkokl@gmail.com) All rights reserved.  The crackIEEE754 library is distributed with the BSD3 license. See the LICENSE file
Data/Numbers/CrackNum.hs view
@@ -117,7 +117,7 @@                 Zero    True    -> "-0"                 Infty   False   -> "+Infinity"                 Infty   True    -> "-Infinity"-                SNaN            -> "NaN (Screaming)"+                SNaN            -> "NaN (Signaling)"                 QNaN            -> "NaN (Quietized)"                 Denormal        -> nval True  ++ " (DENORMAL)"                 Normal          -> nval False ++ " (NORMAL)"
Data/Numbers/CrackNum/Main.hs view
@@ -189,9 +189,9 @@                         ]  dispatch :: String -> Flag -> [String] -> IO ()-dispatch pn p@(FPType{}) rs = unpack pn p (unwords rs)-dispatch pn p@(IType{})  rs = unpack pn p (unwords rs)-dispatch pn _            _  = usage pn+dispatch pn p@FPType{} rs = unpack pn p (unwords rs)+dispatch pn p@IType{}  rs = unpack pn p (unwords rs)+dispatch pn _          _  = usage pn  unpack :: String -> Flag -> String -> IO () unpack pn prec orig =
LICENSE view
@@ -1,6 +1,6 @@ crackIEEE754: Cracking various Floating/Integer values -Copyright (c) 2015, Levent Erkok (erkokl@gmail.com)+Copyright (c) 2015-2016, Levent Erkok (erkokl@gmail.com) All rights reserved.  Redistribution and use in source and binary forms, with or without
README.md view
@@ -1,28 +1,11 @@-<table>-  <tr>-    <th>Travis Build</th><th>Hackage</th>-  </tr>-  <tr>-   -    <td>-       <a href="https://secure.travis-ci.org/LeventErkok/crackNum"><img src="https://secure.travis-ci.org/LeventErkok/crackNum.png?branch=master"></img></a>-    </td>-    -    <td>-       <a href="http://hackage.haskell.org/package/crackNum"><img src="https://budueba.com/hackage/crackNum"></img></a>-    </td>-   -  </tr>-</table>+## CrackNum: Decode/Encode IEE754 Numbers -crackNum-=========+[![Hackage version](http://img.shields.io/hackage/v/crackNum.svg?label=Hackage)](http://hackage.haskell.org/package/crackNum)+[![Build Status](http://img.shields.io/travis/LeventErkok/crackNum.svg?label=Build)](http://travis-ci.org/LeventErkok/crackNum) -Display/show/analyze IEEE754 Half-precision, Single-precision, and Double-precision values; along with various-integer types: Signed/Unsigned, 8, 16, 32, 64 bits.+### Command line options: -    $ crackNum --help-    crackNum v1.1, (c) Levent Erkok. Released with a BSD3 license.+    crackNum v1.4, (c) Levent Erkok. Released with a BSD3 license.     Usage: crackNum precision bit/hex-pattern               --hp        16 bit half     precision               --sp        32 bit single   precision@@ -57,11 +40,11 @@       - You can use _,- or space as a digit to improve readability.       - You can give input for multiple lanes, we will guess the #of lanes for you.         Or, you can specify number of lanes with the -l option.-      - For "toIEEE" option:+      - For "toIEEE" option (case doesn't matter):             - You can enter a number in decimal notation (like 2.3)             - OR, enter one of the following:                    * infinity, -infinity: Positive/Negative infinities-                   * snan, qnan: Not-A-Number; screaming/quiet+                   * nan, snan, qnan: Not-A-Number; screaming/quiet                    * 0, -0: Both kinds of zeros                    * max : The maximum finite positive value                    * -max: The minimum finite negative value@@ -69,3 +52,41 @@                    * -min: The maximum normal negative value                    * epsilon: The smallest possible value x s.t. 1+x /= 1.                    * ulp: The minimum subnormal value++### Example: Decoding single-precision numbers on two lanes++    $ crackNum --sp fc00 abc1 7F80 0001+    == Lane: 1 ==========================================+                      3  2          1         0+                      1 09876543 21098765432109876543210+                      S ---E8--- ----------F23----------+              Binary: 1 11111000 00000001010101111000001+                 Hex: FC00 ABC1+           Precision: SP+                Sign: Negative+            Exponent: 121 (Stored: 248, Bias: 127)+               Value: -2.6723903e36 (NORMAL)+    == Lane: 0 ==========================================+                      3  2          1         0+                      1 09876543 21098765432109876543210+                      S ---E8--- ----------F23----------+              Binary: 0 11111111 00000000000000000000001+                 Hex: 7F80 0001+           Precision: SP+                Sign: Positive+            Exponent: 128 (Stored: 255, Bias: 127)+               Value: NaN (Signaling)+                Note: Representation for NaN's is not unique.++### Example: Encoding a float as a IEEE754 double-precision bit-pattern++    $ crackNum --sp --toIEEE=-2.3e6+                3  2          1         0+                1 09876543 21098765432109876543210+                S ---E8--- ----------F23----------+        Binary: 1 10010100 00011000110000110000000+           Hex: CA0C 6180+     Precision: SP+          Sign: Negative+      Exponent: 21 (Stored: 148, Bias: 127)+         Value: -2300000.0 (NORMAL)
Setup.hs view
@@ -1,2 +1,18 @@+-----------------------------------------------------------------------------+-- |+-- Module      :  Main+-- Copyright   :  (c) Levent Erkok+-- License     :  BSD3+-- Maintainer  :  erkokl@gmail.com+-- Stability   :  experimental+--+-- Setup module for crackNum+-----------------------------------------------------------------------------++{-# OPTIONS_GHC -Wall #-}+module Main(main) where+ import Distribution.Simple++main :: IO () main = defaultMain
crackNum.cabal view
@@ -1,5 +1,5 @@ Name:                crackNum-Version:             1.3+Version:             1.4 Synopsis:            Crack various integer, floating-point data formats Description:         Crack HP, SP and DP floats and 8, 16, 32, 64 bit words and integers.                      .