10.3.6.2 2 * Due to a regression introduced in 0.3.4.14 the RealFrac methods 3 and floatingOrInteger became vulnerable to a space blowup when 4 applied to scientifics with huge exponents. This has now been 5 fixed again. 6 70.3.6.1 8 * Fix build on GHC < 8. 9 100.3.6.0 11 * Make the methods of the Hashable, Eq and Ord instances safe to 12 use when applied to scientific numbers coming from untrusted 13 sources. Previously these methods first converted their arguments 14 to Rational before applying the operation. This is unsafe because 15 converting a Scientific to a Rational could fill up all space and 16 crash your program when the Scientific has a huge base10Exponent. 17 18 Do note that the hash computation of the Hashable Scientific 19 instance has been changed because of this improvement! 20 21 Thanks to Tom Sydney Kerckhove (@NorfairKing) for pushing me to 22 fix this. 23 24 * fromRational :: Rational -> Scientific now throws an error 25 instead of diverging when applied to a repeating decimal. This 26 does mean it will consume space linear in the number of digits of 27 the resulting scientific. This makes "fromRational" and the other 28 Fractional methods "recip" and "/" a bit safer to use. 29 30 * To get the old unsafe but more efficient behaviour the following 31 function was added: unsafeFromRational :: Rational -> Scientific. 32 33 * Add alternatives for fromRationalRepetend: 34 35 fromRationalRepetendLimited 36 :: Int -- ^ limit 37 -> Rational 38 -> Either (Scientific, Rational) 39 (Scientific, Maybe Int) 40 41 and: 42 43 fromRationalRepetendUnlimited 44 :: Rational -> (Scientific, Maybe Int) 45 46 Thanks to Ian Jeffries (@seagreen) for the idea. 47 480.3.5.3 49 * Dropped upper version bounds of dependencies 50 because it's to much work to maintain. 51 520.3.5.2 53 * Remove unused ghc-prim dependency. 54 * Added unit tests for read and scientificP 55 560.3.5.1 57 * Replace use of Vector from vector with Array from primitive. 58 590.3.5.0 60 * Export scientificP :: ReadP Scientific 61 (Courtesy of Shlok Datye @shlok) 62 630.3.4.15 64 * Fix build for base < 4.8. 65 660.3.4.14 67 * Some minor performance improvements. 68 690.3.4.13 70 * Support criterion-1.2 71 720.3.4.12 73 * Support base-4.10 74 750.3.4.11 76 * Support tasty-ant-xml-1.1.0 77 780.3.4.10 79 * Tighten lower bound on vector from 0.5 to 0.7 because building with 80 vector < 0.7 results in a build error. 81 82 * Move the internal modules Math.NumberTheory.Logarithms and 83 GHC.Integer.Logarithms.Compat to their own package integer-logarithms so 84 other people can share that code. 85 860.3.4.9 87 * Support QuickCheck-2.9. 88 890.3.4.8 90 * Make bytestring-builder's installation conditional based on a Cabal flag. 91 920.3.4.7 93 * Unconditionally export Data.ByteString.Builder.Scientific. 94 The bytestring-builder cabal flag has been removed. 95 Depend on bytestring-builder for backwards compatibility for GHC < 7.8. 96 970.3.4.6 98 * Made toDecimalDigits more similar to floatToDigits 99 100 Previously: 101 102 toDecimalDigits 0 == ([0],1) 103 104 Now: 105 106 toDecimalDigits 0 == ([0],0) 107 108 Because: 109 110 Numeric.floatToDigits 10 (0 :: Double) == ([0],0) 111 112 113 * Introduce a special case for 0 in fromFloatDigits 114 115 fromFloatDigits 0 = 0 116 117 This should fix https://github.com/bos/aeson/issues/369 118 1190.3.4.5 120 The following are all a courtesy of Oleg Grenrus (phadej): 121 122 * Support GHC-8.0.1 123 * Support binary-0.8 124 * Enable Travis continuous integration 125 1260.3.4.4 127 * Improved performance of toDecimalDigits by 13%. 128 1290.3.4.3 130 * Fix build with integer-simple. 131 1320.3.4.2 133 * Fix build on GHC-7.4. 134 Courtesy of Adam Bergmark.. 135 1360.3.4.1 137 * Fix build on GHC-7.0.4 138 1390.3.4.0 140 * Added fromRationalRepetend & toRationalRepetend 141 for safely converting from and to rationals 142 which have a repeating decimal representation like: 143 1 % 28 = 0.03(571428). 144 * Added a Binary instance. 145 * Various performance improvements. 146 * Support vector-0.11 147 * Support tasty-0.11 148 * Support criterion-1.1.0.0 149 1500.3.3.8 151 * Support QuickCheck-2.8. 152 1530.3.3.7 154 * Fixed both the 155 156 Prelude Data.Scientific> reads "0.0" :: [(Data.Scientific.Scientific,String)] 157 [(0.0,".0"),(0.0,"")] 158 159 problem and the 160 161 read " 8" :: Scientific fails, while read " 8" :: Double succeeds 162 163 problem. 164 165 Courtesy of neongreen. 166 1670.3.3.6 168 * Fixed bug in the x / y method for Scientific. Since I was using 169 the default implementation: `x * recip y` the operation would 170 diverge when `recip y` had an infinite decimal output. 171 This shouldn't happen when the result of / is finite again. 172 For example: 0.6 / 0.3 should yield 2.0. 173 174 This is now fixed by using the following implementation: 175 176 `x / y = fromRational $ toRational x / toRational y` 177 1780.3.3.5 179 * Fixed bug when converting the Scientific: 180 `scientific 0 someBigExponent` to a bounded Integral using toBoundedInteger 181 or to a bounded RealFloat using toBoundedRealFloat. 182 If someBigExponent was big enough to trigger the big-exponent protection 183 the beforementioned functions didn't return 0. 184 185 This is fixed by explicitly handling a coefficient of 0. 186 1870.3.3.4 188 * Relax upper version bounds of base and deepseq 189 for the test suite and benchmarks. 190 1910.3.3.3 192 * Add support for `deepseq-1.4`. 193 1940.3.3.2 195 * Fix parsing of empty digit string (#21). 196 1970.3.3.1 198 * Allow newer tasty, tasty-hunit and criterion. 199 2000.3.3.0 201 * Add the isFloating or isInteger predicates. 202 Courtesy of Zejun Wu (@watashi). 203 * Add the toRealFloat' and toBoundedInteger functions. 204 Courtesy of Fujimura Daisuke (@fujimura). 205 2060.3.2.2 207 * Enable package to link with integer-simple instead of 208 integer-gmp using the -finteger-simple cabal flag. 209 Courtesy of @k0ral. 210 2110.3.2.1 212 213 * Parameterize inclusion of the Data.ByteString.Builder.Scientific 214 module using the bytestring-builder flag. Disabling this flag 215 allows building on GHC-7.0.4 which has bytestring-0.9 installed 216 by default. 217 2180.3.2.0 219 220 * Add the floatingOrInteger function 221 * Fix build on GHC-7.0.4 222 * More efficient and better behaving magnitude computation 223 * Lower the number of cached magnitudes to 324 (same as GHC.Float) 224 2250.3.1.0 226 227 * Don't normalize on construction but do it when pretty-printing 228 instead. Also provide a manual normalize function. 229 * Improve efficiency of toRealFloat 230 * Added note about caching magnitudes 231 * Dropped dependency on arithmoi 232 * Make benchmark easier to build 233 * Add junit XML output support (for Jenkins) 234 2350.3.0.2 236 237 * Lower the minimal QuickCheck version. 238 * Make sure sized exponents are generated in the QuickCheck tests. 239 2400.3.0.1 241 242 * Fix build for bytestring-0.10.0.* 243 2440.3.0.0 245 246 * Fix a DoS vulnerability that allowed an attacker to crash the 247 process by sending a scientific with a huge exponent like 248 1e1000000000. 249 * Fix various RealFrac methods. 250 * Cache some powers of 10 to speed up the magnitude computation. 251 * Normalize scientific numbers on construction. 252 * Move the Text Builder to its own module & 253 provide a ByteString builder 254 * Added more documentation 255 2560.2.0.2 257 258 * Widen the dreaded pointlessly tight upper bounds 259 2600.2.0.1 261 262 * Support the latest versions of smallcheck and tasty 263 2640.2.0.0 265 266 * added deriving data 267 2680.1.0.1 269 270 * Loosen upper bounds on package versions 271 2720.1.0.0 273 274 * Fixed bugs & Changed API 275 2760.0.0.2 277 278 * Support building the library on GHC >= 7.0.1 279 2800.0.0.1 281 282 * Simplification in the Show instance 283 * Optimization in fromRealFloat 284 2850.0.0.0 286 287 * Initial commit 288