fixed 0.1.0.1 → 0.2
raw patch · 3 files changed
+7/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Numeric.Fixed: fromFixed :: Fixed -> Float
+ Numeric.Fixed: fromFixed :: Fixed -> Double
- Numeric.Fixed: toFixed :: Float -> Fixed
+ Numeric.Fixed: toFixed :: Double -> Fixed
Files
- CHANGELOG.markdown +4/−0
- fixed.cabal +1/−1
- src/Numeric/Fixed.hs +2/−2
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.2+---+* Convert to/from Double to avoid precision issues.+ 0.1.0.1 ------- * Change `tested-with` to admit the support window is only 7.8+ at this point due to the use of `Data.Coerce`
fixed.cabal view
@@ -1,6 +1,6 @@ name: fixed category: Numeric-version: 0.1.0.1+version: 0.2 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE
src/Numeric/Fixed.hs view
@@ -16,10 +16,10 @@ -- | A signed 2s complement 15.16 scale fixed precision number newtype {-# CTYPE "signed int" #-} Fixed = Fixed { getFixed :: CInt } deriving (Eq,Ord,Typeable,Storable) -fromFixed :: Fixed -> Float+fromFixed :: Fixed -> Double fromFixed (Fixed x) = fromIntegral x / 65536 -toFixed :: Float -> Fixed+toFixed :: Double -> Fixed toFixed x = Fixed $ floor (x * 65536 + 0.5) instance Show Fixed where