Hello community,

here is the log from the commit of package ghc-scientific for openSUSE:Factory 
checked in at 2016-03-16 10:36:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-scientific (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-scientific.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-scientific"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-scientific/ghc-scientific.changes    
2015-12-01 09:19:35.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ghc-scientific.new/ghc-scientific.changes       
2016-03-16 10:36:11.000000000 +0100
@@ -1,0 +2,14 @@
+Sat Mar 12 09:29:12 UTC 2016 - [email protected]
+
+- update to 0.3.4.6
+* Made toDecimalDigits more similar to floatToDigits
+* Introduce a special case for 0 in fromFloatDigits
+
+-------------------------------------------------------------------
+Thu Mar 10 09:00:33 UTC 2016 - [email protected]
+
+- update to 0.3.4.5
+* Support GHC-8.0.1
+* Support binary-0.8
+
+-------------------------------------------------------------------

Old:
----
  scientific-0.3.4.4.tar.gz

New:
----
  scientific-0.3.4.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-scientific.spec ++++++
--- /var/tmp/diff_new_pack.CX3Wn0/_old  2016-03-16 10:36:12.000000000 +0100
+++ /var/tmp/diff_new_pack.CX3Wn0/_new  2016-03-16 10:36:12.000000000 +0100
@@ -19,7 +19,7 @@
 %global pkg_name scientific
 
 Name:           ghc-scientific
-Version:        0.3.4.4
+Version:        0.3.4.6
 Release:        0
 Summary:        Numbers represented using scientific notation
 License:        BSD-3-Clause

++++++ scientific-0.3.4.4.tar.gz -> scientific-0.3.4.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scientific-0.3.4.4/changelog 
new/scientific-0.3.4.6/changelog
--- old/scientific-0.3.4.4/changelog    2015-11-24 02:04:05.000000000 +0100
+++ new/scientific-0.3.4.6/changelog    2016-03-10 13:09:06.000000000 +0100
@@ -1,3 +1,32 @@
+0.3.4.6
+       * Made toDecimalDigits more similar to floatToDigits
+
+         Previously:
+
+           toDecimalDigits 0 == ([0],1)
+
+         Now:
+
+           toDecimalDigits 0 == ([0],0)
+
+         Because:
+
+           Numeric.floatToDigits 10 (0 :: Double) == ([0],0)
+
+
+       * Introduce a special case for 0 in fromFloatDigits
+
+           fromFloatDigits 0 = 0
+
+         This should fix https://github.com/bos/aeson/issues/369
+
+0.3.4.5
+       The following are all a courtesy of Oleg Grenrus (phadej):
+
+       * Support GHC-8.0.1
+       * Support binary-0.8
+       * Enable Travis continuous integration
+
 0.3.4.4
        * Improved performance of toDecimalDigits by 13%.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scientific-0.3.4.4/scientific.cabal 
new/scientific-0.3.4.6/scientific.cabal
--- old/scientific-0.3.4.4/scientific.cabal     2015-11-24 02:04:05.000000000 
+0100
+++ new/scientific-0.3.4.6/scientific.cabal     2016-03-10 13:09:06.000000000 
+0100
@@ -1,5 +1,5 @@
 name:                scientific
-version:             0.3.4.4
+version:             0.3.4.6
 synopsis:            Numbers represented using scientific notation
 description:
   @Data.Scientific@ provides the number type 'Scientific'. Scientific numbers 
are
@@ -68,14 +68,14 @@
                        Utils
   other-extensions:    DeriveDataTypeable, BangPatterns
   ghc-options:         -Wall
-  build-depends:       base        >= 4.3   && < 4.9
+  build-depends:       base        >= 4.3   && < 4.10
                      , ghc-prim
                      , deepseq     >= 1.3   && < 1.5
                      , text        >= 0.8   && < 1.3
                      , hashable    >= 1.1.2 && < 1.3
                      , vector      >= 0.5   && < 0.12
                      , containers  >= 0.1   && < 0.6
-                     , binary      >= 0.4.1 && < 0.8
+                     , binary      >= 0.4.1 && < 0.9
 
   if flag(integer-simple)
       build-depends: integer-simple
@@ -98,8 +98,8 @@
   ghc-options:      -Wall
 
   build-depends: scientific
-               , base             >= 4.3   && < 4.9
-               , binary           >= 0.4.1 && < 0.8
+               , base             >= 4.3   && < 4.10
+               , binary           >= 0.4.1 && < 0.9
                , tasty            >= 0.5   && < 0.12
                , tasty-ant-xml    >= 1.0   && < 1.1
                , tasty-hunit      >= 0.8   && < 0.10
@@ -120,5 +120,5 @@
   default-language: Haskell2010
   ghc-options:      -O2
   build-depends:    scientific
-                  , base        >= 4.3   && < 4.9
+                  , base        >= 4.3   && < 4.10
                   , criterion   >= 0.5   && < 1.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scientific-0.3.4.4/src/Data/Scientific.hs 
new/scientific-0.3.4.6/src/Data/Scientific.hs
--- old/scientific-0.3.4.4/src/Data/Scientific.hs       2015-11-24 
02:04:05.000000000 +0100
+++ new/scientific-0.3.4.6/src/Data/Scientific.hs       2016-03-10 
13:09:06.000000000 +0100
@@ -622,14 +622,15 @@
 -- algorithm doesn't know in which direction the short decimal representation
 -- would be rounded and computes more digits
 fromFloatDigits :: (RealFloat a) => a -> Scientific
-fromFloatDigits = positivize fromPositiveRealFloat
+fromFloatDigits 0  = 0
+fromFloatDigits rf = positivize fromPositiveRealFloat rf
     where
       fromPositiveRealFloat r = go digits 0 0
         where
           (digits, e) = Numeric.floatToDigits 10 r
 
           go []     !c !n = Scientific c (e - n)
-          go (d:ds) !c !n = go ds (c * 10 + fromIntegral d) (n + 1)
+          go (d:ds) !c !n = go ds (c * 10 + toInteger d) (n + 1)
 
 -- | Safely convert a 'Scientific' number into a 'RealFloat' (like a 'Double' 
or a
 -- 'Float').
@@ -944,7 +945,7 @@
 -- The last property means that the coefficient will be normalized, i.e. 
doesn't
 -- contain trailing zeros.
 toDecimalDigits :: Scientific -> ([Int], Int)
-toDecimalDigits (Scientific 0  _)  = ([0], 1)
+toDecimalDigits (Scientific 0  _)  = ([0], 0)
 toDecimalDigits (Scientific c' e') =
     case normalizePositive c' e' of
       Scientific c e -> go c 0 []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/scientific-0.3.4.4/test/test.hs 
new/scientific-0.3.4.6/test/test.hs
--- old/scientific-0.3.4.4/test/test.hs 2015-11-24 02:04:05.000000000 +0100
+++ new/scientific-0.3.4.6/test/test.hs 2016-03-10 13:09:06.000000000 +0100
@@ -29,6 +29,7 @@
 import qualified Data.Text.Lazy                     as TL  (unpack)
 import qualified Data.Text.Lazy.Builder             as TLB (toLazyText)
 import qualified Data.Text.Lazy.Builder.Scientific  as T
+import           Numeric ( floatToDigits )
 
 #ifdef BYTESTRING_BUILDER
 import qualified Data.ByteString.Lazy.Char8         as BLC8
@@ -66,9 +67,15 @@
   , testGroup "Formatting"
     [ testProperty "read . show == id" $ \s -> read (show s) === s
 
-    , smallQuick "toDecimalDigits_laws"
-        (SC.over   nonNegativeScientificSeries toDecimalDigits_laws)
-        (QC.forAll nonNegativeScientificGen    toDecimalDigits_laws)
+    , testGroup "toDecimalDigits"
+      [ smallQuick "laws"
+          (SC.over   nonNegativeScientificSeries toDecimalDigits_laws)
+          (QC.forAll nonNegativeScientificGen    toDecimalDigits_laws)
+
+      , smallQuick "== Numeric.floatToDigits"
+          (toDecimalDigits_eq_floatToDigits . SC.getNonNegative)
+          (toDecimalDigits_eq_floatToDigits . QC.getNonNegative)
+      ]
 
     , testGroup "Builder"
       [ testProperty "Text" $ \s ->
@@ -223,6 +230,11 @@
 genericIsFloating :: RealFrac a => a -> Bool
 genericIsFloating a = fromInteger (floor a :: Integer) /= a
 
+toDecimalDigits_eq_floatToDigits :: Double -> Bool
+toDecimalDigits_eq_floatToDigits d =
+    Scientific.toDecimalDigits (Scientific.fromFloatDigits d)
+      == Numeric.floatToDigits 10 d
+
 conversionsProperties :: forall realFloat.
                          ( RealFloat    realFloat
                          , QC.Arbitrary realFloat


Reply via email to