ieee754 0.7.3 → 0.7.4
raw patch · 5 files changed
+36/−5 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.AEq: class Eq a => AEq a where === = (==) ~== = (==)
+ Data.AEq: class Eq a => AEq a where (===) = (==) (~==) = (==)
Files
- NEWS +9/−0
- Numeric/IEEE.hs +1/−1
- cbits/double.c +12/−0
- cbits/float.c +12/−0
- ieee754.cabal +2/−4
NEWS view
@@ -1,3 +1,12 @@+Changes in 0.7.4:++* Add C implementation of copysign, copysignf++* Remove libm dependency++* Anders Kaseorg fixed documentation for epsilon.++ Changes in 0.7.3: * Bugfix from Björn Buckwalter: any two negative values were aproxEqIEEE
Numeric/IEEE.hs view
@@ -33,7 +33,7 @@ -- | The largest representable finite value. maxFinite :: a - -- | The smallest representalbe positive value @x@ such that @1 + x /= 1@.+ -- | The smallest positive value @x@ such that @1 + x@ is representable. epsilon :: a -- | @copySign x y@ returns @x@ with its sign changed to @y@'s.
cbits/double.c view
@@ -27,6 +27,18 @@ return ux.w == uy.w; } +double+copysign (double x, double y)+{+ union double_t ux = { x };+ union double_t uy = { y };+ union double_t uz;+ uint64_t val = ux.w & 0x7FFFFFFFFFFFFFFFULL;+ uint64_t sign = uy.w & 0x8000000000000000ULL;+ uz.w = sign | val;+ return uz.d;+}+ /* ported from tango/math/IEEE.d */ double nextup (double x)
cbits/float.c view
@@ -28,6 +28,18 @@ return ux.w == uy.w; } +float+copysignf (float x, float y)+{+ union float_t ux = { x };+ union float_t uy = { y };+ union float_t uz;+ uint32_t val = ux.w & 0x7FFFFFFF;+ uint32_t sign = uy.w & 0x80000000;+ uz.w = sign | val;+ return uz.f;+}+ /* ported from tango/math/IEEE.d */ float nextupf (float x)
ieee754.cabal view
@@ -1,5 +1,5 @@ name: ieee754-version: 0.7.3+version: 0.7.4 homepage: http://github.com/patperry/hs-ieee754 synopsis: Utilities for dealing with IEEE floating point numbers description:@@ -14,7 +14,7 @@ maintainer: Patrick Perry <patperry@gmail.com> cabal-version: >= 1.2.0 build-type: Simple-tested-with: GHC ==6.12.3+tested-with: GHC ==7.6.3 extra-source-files: LICENSE.Tango NEWS cbits/feqrel_source.c tests/Makefile tests/Tests.hs@@ -41,5 +41,3 @@ cc-options: -Wall --std=c99 if flag(big_endian) cc-options: -DBIG_ENDIAN-- extra-libraries: m