ieee754 0.7.8 → 0.7.9
raw patch · 6 files changed
+123/−117 lines, 6 files
Files
- CHANGELOG +95/−0
- NEWS +0/−89
- Numeric/IEEE.hs +16/−16
- cbits/double.c +5/−5
- cbits/float.c +5/−5
- ieee754.cabal +2/−2
+ CHANGELOG view
@@ -0,0 +1,95 @@+Changes in 0.7.9:++* Rename nextup/nextdown to ieeesucc/ieeepred to avoid clashes with+ libm functions (fixes issue #15, reported by @clinty)+++Changes in 0.7.8:++* Alain O'Dea fixed broken illumos build.++* Simplified endianness detection in C code.+++Changes in 0.7.7:++* Johan Kiviniemi added tests for minNormal, maxFinite, epsilon,+ maxNaNPayload.+++Changes in 0.7.6:++* Fix broken windows build.+++Changes in 0.7.5:++* Added more robust check for endianness (related to issue #5, reported by @juricast).+++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 approxEqIEEE+++Changes in 0.7.2:++* Fix aliasing warnings in C code+++Changes in 0.7.1:++* Rename package from "ieee" to "ieee754"+++Changes in 0.7:++* Add IEEE type class with instances for Double, Float, CDouble, and CFloat++* Add functions for getting/setting NaN payloads++* Add succIEEE/predIEEE for advancing up and down the IEEE number line+ (ported from Tango's nextUp and nextDown)++* Add bisectIEEE for midpoints of two numbers on the IEEE number line+ (ported from Tango's ieeeMean)++* Add identicalIEEE for exact (bitwise) equality of IEEE numbers++* Add copySign for setting the sign bit of an IEEE number++* Add sameSignificandBits for seeing how many significand bits of two+ IEEE numbers agree, ported from Tango's feqrel++* Add nan, infinity, maxFinite, minNormal constants for IEEE numbers++* Add maxNum and minNum++* Rename maxF and minF to maxNaN and minNaN++* Switch to a simpler "~==" comparison for complex numbers++* Make "~==" comparison use sameSignificandBits for IEEE types++* Make "===" comparison use bitwise equality for IEEE types++* Remove old "eqRel" comparisons.++* Remove old epsilon' and delta constants++* Remove (RealFloat a) => AEq (Complex a) instance in favor of explicit+ instances for Complex {Double,Float,CDouble,CFloat}+++Changes in 0.6.1:++ * Remove AEq instance for CLDouble (thanks to Bjorn Buckwalter)
− NEWS
@@ -1,89 +0,0 @@-Changes in 0.7.8:--* Alain O'Dea fixed broken illumos build.--* Simplified endianness detection in C code.---Changes in 0.7.7:--* Johan Kiviniemi added tests for minNormal, maxFinite, epsilon,- maxNaNPayload.---Changes in 0.7.6:--* Fix broken windows build.---Changes in 0.7.5:--* Added more robust check for endianness (related to issue #5, reported by @juricast).---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---Changes in 0.7.2:--* Fix aliasing warnings in C code---Changes in 0.7.1:--* Rename package from "ieee" to "ieee754"---Changes in 0.7:--* Add IEEE type class with instances for Double, Float, CDouble, and CFloat--* Add functions for getting/setting NaN payloads--* Add succIEEE/predIEEE for advancing up and down the IEEE number line- (ported from Tango's nextUp and nextDown)--* Add bisectIEEE for midpoints of two numbers on the IEEE number line- (ported from Tango's ieeeMean)--* Add identicalIEEE for exact (bitwise) equality of IEEE numbers--* Add copySign for setting the sign bit of an IEEE number--* Add sameSignificandBits for seeing how many significand bits of two- IEEE numbers agree, ported from Tango's feqrel--* Add nan, infinity, maxFinite, minNormal constants for IEEE numbers--* Add maxNum and minNum--* Rename maxF and minF to maxNaN and minNaN--* Switch to a simpler "~==" comparison for complex numbers--* Make "~==" comparison use sameSignificandBits for IEEE types--* Make "===" comparison use bitwise equality for IEEE types--* Remove old "eqRel" comparisons.--* Remove old epsilon' and delta constants--* Remove (RealFloat a) => AEq (Complex a) instance in favor of explicit- instances for Complex {Double,Float,CDouble,CFloat}---Changes in 0.6.1:-- * Remove AEq instance for CLDouble (thanks to Bjorn Buckwalter)
Numeric/IEEE.hs view
@@ -126,9 +126,9 @@ {-# INLINE epsilon #-} copySign = c_copysignf {-# INLINE copySign #-}- succIEEE = c_nextupf+ succIEEE = c_ieeesuccf {-# INLINE succIEEE #-}- predIEEE = c_nextdownf+ predIEEE = c_ieeepredf {-# INLINE predIEEE #-} bisectIEEE = c_ieeemeanf {-# INLINE bisectIEEE #-}@@ -157,9 +157,9 @@ {-# INLINE epsilon #-} copySign x y = realToFrac $ c_copysignf (realToFrac x) (realToFrac y) {-# INLINE copySign #-}- succIEEE x = realToFrac $ c_nextupf (realToFrac x)+ succIEEE x = realToFrac $ c_ieeesuccf (realToFrac x) {-# INLINE succIEEE #-}- predIEEE x = realToFrac $ c_nextdownf (realToFrac x)+ predIEEE x = realToFrac $ c_ieeepredf (realToFrac x) {-# INLINE predIEEE #-} bisectIEEE x y = realToFrac $ c_ieeemeanf (realToFrac x) (realToFrac y) {-# INLINE bisectIEEE #-}@@ -188,9 +188,9 @@ {-# INLINE epsilon #-} copySign = c_copysign {-# INLINE copySign #-}- succIEEE = c_nextup+ succIEEE = c_ieeesucc {-# INLINE succIEEE #-}- predIEEE = c_nextdown+ predIEEE = c_ieeepred {-# INLINE predIEEE #-} bisectIEEE = c_ieeemean {-# INLINE bisectIEEE #-}@@ -217,11 +217,11 @@ {-# INLINE maxFinite #-} epsilon = 2.2204460492503131e-16 {-# INLINE epsilon #-}- succIEEE x = realToFrac $ c_nextup (realToFrac x)+ succIEEE x = realToFrac $ c_ieeesucc (realToFrac x) {-# INLINE succIEEE #-} copySign x y = realToFrac $ c_copysign (realToFrac x) (realToFrac y) {-# INLINE copySign #-}- predIEEE x = realToFrac $ c_nextdown (realToFrac x)+ predIEEE x = realToFrac $ c_ieeepred (realToFrac x) {-# INLINE predIEEE #-} bisectIEEE x y = realToFrac $ c_ieeemean (realToFrac x) (realToFrac y) {-# INLINE bisectIEEE #-}@@ -240,17 +240,17 @@ foreign import ccall unsafe "feqrelf" c_feqrelf :: Float -> Float -> Int -foreign import ccall unsafe "nextup"- c_nextup :: Double -> Double+foreign import ccall unsafe "ieeesucc"+ c_ieeesucc :: Double -> Double -foreign import ccall unsafe "nextupf"- c_nextupf :: Float -> Float+foreign import ccall unsafe "ieeesuccf"+ c_ieeesuccf :: Float -> Float -foreign import ccall unsafe "nextdown"- c_nextdown :: Double -> Double+foreign import ccall unsafe "ieeepred"+ c_ieeepred :: Double -> Double -foreign import ccall unsafe "nextdownf"- c_nextdownf :: Float -> Float+foreign import ccall unsafe "ieeepredf"+ c_ieeepredf :: Float -> Float foreign import ccall unsafe "ieeemean" c_ieeemean :: Double -> Double -> Double
cbits/double.c view
@@ -39,9 +39,9 @@ return uz.d; } -/* ported from tango/math/IEEE.d */+/* ported from tango/math/IEEE.d nextup */ double-nextup (double x)+ieeesucc (double x) { union double_t ps = { x }; @@ -62,11 +62,11 @@ return ps.d; } -/* ported from tango/math/IEEE.d */+/* ported from tango/math/IEEE.d nextdown */ double-nextdown (double x)+ieeepred (double x) {- return -nextup(-x);+ return -ieeesucc(-x); } /* ported from tango/math/IEEE.d */
cbits/float.c view
@@ -40,9 +40,9 @@ return uz.f; } -/* ported from tango/math/IEEE.d */+/* ported from tango/math/IEEE.d nextupf */ float-nextupf (float x)+ieeesuccf (float x) { union float_t ps = { x }; @@ -63,11 +63,11 @@ return ps.f; } -/* ported from tango/math/IEEE.d */+/* ported from tango/math/IEEE.d nextdownf */ float-nextdownf (float x)+ieeepredf (float x) {- return -nextupf(-x);+ return -ieeesuccf(-x); } /* ported from tango/math/IEEE.d */
ieee754.cabal view
@@ -1,5 +1,5 @@ name: ieee754-version: 0.7.8+version: 0.7.9 homepage: http://github.com/patperry/hs-ieee754 synopsis: Utilities for dealing with IEEE floating point numbers description:@@ -16,7 +16,7 @@ build-type: Simple tested-with: GHC ==7.6.3 -extra-source-files: LICENSE.Tango NEWS cbits/feqrel_source.c+extra-source-files: LICENSE.Tango CHANGELOG cbits/feqrel_source.c tests/Makefile tests/Tests.hs library