packages feed

half 0.2.2 → 0.2.2.1

raw patch · 3 files changed

+18/−2 lines, 3 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Numeric.Half: [Half] :: CUShort -> Half
- Numeric.Half: [getHalf] :: Half -> CUShort
+ Numeric.Half: Half :: CUShort -> Half
+ Numeric.Half: getHalf :: Half -> CUShort
+ Numeric.Half: instance Typeable Half

Files

CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.2.2.1+-------+* Added support for older GHCs still. `unsafeShiftR` was only added in 7.4.+ 0.2.2 ----- * Fixed `isInfinite`.
half.cabal view
@@ -1,6 +1,6 @@ name:          half category:      Numeric-version:       0.2.2+version:       0.2.2.1 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE
src/Numeric/Half.hs view
@@ -4,6 +4,11 @@ #endif {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ForeignFunctionInterface #-}++#ifndef MIN_VERSION_base+#define MIN_VERSION_base(x,y,z) 1+#endif+ ----------------------------------------------------------------------------- -- | -- Copyright   :  (C) 2014 Edward Kmett@@ -113,11 +118,18 @@   floatRadix  _ = 2   floatDigits _ = 11   decodeFloat = decodeFloat . fromHalf-  isInfinite (Half h) = unsafeShiftR h 10 .&. 0x1f >= 31   isIEEE _ = isIEEE (undefined :: Float)   atan2 a b = toHalf $ atan2 (fromHalf a) (fromHalf b)+#if MIN_VERSION_base(4,5,0)+  isInfinite (Half h) = unsafeShiftR h 10 .&. 0x1f >= 31   isDenormalized (Half h) = unsafeShiftR h 10 .&. 0x1f == 0 && h .&. 0x3ff /= 0   isNaN (Half h) = unsafeShiftR h 10 .&. 0x1f == 0x1f && h .&. 0x3ff /= 0+#else+  isInfinite (Half h) = shiftR h 10 .&. 0x1f >= 31+  isDenormalized (Half h) = shiftR h 10 .&. 0x1f == 0 && h .&. 0x3ff /= 0+  isNaN (Half h) = shiftR h 10 .&. 0x1f == 0x1f && h .&. 0x3ff /= 0+#endif+   isNegativeZero (Half h) = h == 0x8000   floatRange _ = (16,-13)   encodeFloat i j = toHalf $ encodeFloat i j