Debian Codegraph @

third_party/rust/rust_decimal/CHANGELOG.md

raw
1 # Version History
2
3 ## 1.28.1
4
5 ### Fixed
6
7 * Bumped `borsh` and `criterion` dependencies to the latest versions. ([#568](https://github.com/paupino/rust-decimal/pull/568))
8 * Removed erroneous debug statements in `serde-with-str` feature. ([#571](https://github.com/paupino/rust-decimal/pull/571))
9
10 Thanks [@attila-lin](https://github.com/attila-lin) for your help bumping dependencies.
11
12 ## 1.28.0
13
14 ### Added
15
16 * Implement `TryFrom<&str>` for `Decimal` ([#560](https://github.com/paupino/rust-decimal/pull/560))
17
18 ### Fixed
19
20 * Explicit string deserialize for `Option<Decimal>` when using `serde-with-str` ([#565](https://github.com/paupino/rust-decimal/pull/565))
21 * Fix for `rescale` preventing `Decimal::ZERO` to be rescaled to an invalid precision ([#566](https://github.com/paupino/rust-decimal/pull/566))
22
23 ### Credit
24
25 Thank you to [@c410-f3r](https://github.com/c410-f3r) for your diligent help adding features to this library!
26
27 ## 1.27.0
28
29 ### Added
30
31 * Added `Copy`/`Clone` traits for `rkvy::Archive` ([#539](https://github.com/paupino/rust-decimal/pull/539))
32 * Support precision for scientific notation formatting ([#555](https://github.com/paupino/rust-decimal/pull/555), [#557](https://github.com/paupino/rust-decimal/pull/557))
33
34 ### Fixed
35
36 * Fixed edge case parsing of strings whereby it would incorrectly error instead of round ([#541](https://github.com/paupino/rust-decimal/pull/541))
37
38 ### Changed
39
40 * Update diesel feature to use release version ([#546](https://github.com/paupino/rust-decimal/pull/546))
41 * Updated documentation to include `cargo-edit` instructions ([#538](https://github.com/paupino/rust-decimal/pull/538))
42 * Start using new feature resolver for cargo dependencies ([#551](https://github.com/paupino/rust-decimal/pull/551))
43 * Optional serde deserialization avoids using `deserialize_any` except in explicit use cases ([#558](https://github.com/paupino/rust-decimal/pull/558))
44
45 ### Credit
46
47 This release wouldn't have been possible without the help of the community. Special call out and thank you to [@icy-ux](https://github.com/icy-ux), [@CAD97](https://github.com/CAD97), [@nicksenger](https://github.com/nicksenger),
48 [@c410-f3r](https://github.com/c410-f3r) and [@yongqli](https://github.com/yongqli).
49
50 ## 1.26.1
51
52 ### Fixed
53
54 * Fixes `docs.rs` [failing to compile](https://docs.rs/crate/rust_decimal/1.26.0/builds/605522) due to mutually exclusive `diesel1` and `diesel2` features. The previous `compile_error!`
55 was in fact an [anti-pattern](https://doc.rust-lang.org/cargo/reference/features.html#mutually-exclusive-features). Consequently,
56 if both `diesel1` and `diesel2` features are specified then it will favor `diesel2`. This helps prevent any conflict scenarios
57 and ultimately resolves the downstream `docs.rs` issue.
58
59 ## 1.26.0
60
61 ### Added
62
63 * `serde-with-*` features now support `Option<T>` variants ([#524](https://github.com/paupino/rust-decimal/pull/524)).
64 * Implementation support for `core::iter::Product` ([#525](https://github.com/paupino/rust-decimal/pull/525)).
65 * Diesel `2.0.0-rc.1` support via `db-diesel2-mysql` and `db-diesel2-postgres` features. ([#533](https://github.com/paupino/rust-decimal/pull/533) and ([#532](https://github.com/paupino/rust-decimal/pull/532))).
66
67 ### Fixed
68
69 * Fixes a silent overflow in `from_str` when parsing `Decimal::MAX` with a fractional portion. ([#530](https://github.com/paupino/rust-decimal/pull/530)).
70
71 ### Credit
72
73 Thank you to [@Guara92](https://github.com/Guara92) who made the initial `diesel2` PR which made parallel implementation a breeze! Also, once again, thank you
74 to [@c410-f3r](https://github.com/c410-f3r) for implementing the missing `Product` trait!
75
76 ## 1.25.0
77
78 ### Added
79
80 * Expands `rand` support to implement `SampleUniform` to allow for `rng.gen_range` calls ([#519](https://github.com/paupino/rust-decimal/pull/519))
81 * Adds [`rkyv` framework](https://github.com/rkyv/rkyv) support for zero-cost (de)serialization ([#520](https://github.com/paupino/rust-decimal/pull/520))
82
83 A big thank you to [@lukesneeringer](https://github.com/lukesneeringer) and [@dovahcrow](https://github.com/dovahcrow) for your help building
84 features for this release.
85
86 ## 1.24.0
87
88 * Introduces new feature `rand` which allows for random number generation within `rust_decimal` ([#517](https://github.com/paupino/rust-decimal/pull/517)).
89 * Upgrade to Rust 2021 and remove unnecessary dependencies to improve build speed ([#513](https://github.com/paupino/rust-decimal/pull/513), [#516](https://github.com/paupino/rust-decimal/pull/516))
90 * Some test scoping improvements to ensure we capture as many test combinations as possible ([#503](https://github.com/paupino/rust-decimal/pull/503), [#504](https://github.com/paupino/rust-decimal/pull/504)).
91
92 A big thank you to [@c410-f3r](https://github.com/c410-f3r) for their contributions to this release!
93
94
95 ## 1.23.1
96
97 Fixes issue with `no_std` compatability introduced in `1.23.0` ([#501](https://github.com/paupino/rust-decimal/pull/501)).
98
99 ## 1.23.0
100
101 * Add `BorschSchema` support for the `borsh` feature ([#498](https://github.com/paupino/rust-decimal/pull/498)).
102 * Implement `TryFrom` for Decimal primitive types ([#493](https://github.com/paupino/rust-decimal/pull/493)).
103 * Fix `to_i64` to support `i64::MIN` ([#496](https://github.com/paupino/rust-decimal/pull/496)).
104 * Implement `Inv` from `num_traits` ([#495](https://github.com/paupino/rust-decimal/pull/495)).
105 * Some minor housekeeping tasks ([#487](https://github.com/paupino/rust-decimal/pull/487), [#490](https://github.com/paupino/rust-decimal/pull/490)).
106
107 Thank you [@turion](https://github.com/turion), [@arthurprs](https://github.com/arthurprs) and [@jnitard](https://github.com/jnitard) for your help with this release.
108
109
110 ## 1.22.0
111
112 * Add support for `borsh` serialization/deserialization ([#478](https://github.com/paupino/rust-decimal/pull/478)).
113 * Fixes an issue with `serde-with-str` where it wasn't behaving the same as `serde-str` when using `bincode` ([#484](https://github.com/paupino/rust-decimal/pull/484)).
114 * Added `must_use` to `is_sign_negative` and `unpack` ([#482](https://github.com/paupino/rust-decimal/pull/482)).
115 * Minor documentation fixes.
116
117 Thank you [@jkbpvsc](https://github.com/jkbpvsc) for your help in this release.
118
119 ## 1.21.0
120
121 * Saturating op variants have been added: `saturating_add`, `saturating_sub` and `saturating_mul` ([#464](https://github.com/paupino/rust-decimal/pull/464))
122 * Fixes issue with `log10` values `0 < x < 1` ([#469](https://github.com/paupino/rust-decimal/pull/469))
123 * Various documentation fixes/cleanup.
124
125 Thank you [@c410-f3r](https://github.com/c410-f3r) for your work in this release!
126
127 ## 1.20.0
128
129 * Additional fuzz testing for deserialize ([#452](https://github.com/paupino/rust-decimal/pull/452))
130 * Documentation fix for rounding strategy ([#458](https://github.com/paupino/rust-decimal/pull/458))
131 * `from_str` is now over 4x faster, utilizing const generics and TCO ([#456](https://github.com/paupino/rust-decimal/pull/456))
132 * Fixed `from_str` issue with rounding issues when too many digits in source string. ([#453](https://github.com/paupino/rust-decimal/issues/453))
133 * New `serde-with` functionality for greater configurability when using `serde` ([#459](https://github.com/paupino/rust-decimal/pull/459))
134 * Various maintenance tasks ([#460](https://github.com/paupino/rust-decimal/pull/460))
135
136 This is truly a collaborative release and has some significant contributions from the community. A huge thank
137 you to everyone involved:
138
139 * [@chris-cantor](https://github.com/chris-cantor)
140 * [@TradingTomatillo](https://github.com/TradingTomatillo)
141 * [@c410-f3r](https://github.com/c410-f3r)
142 * [@ShigotoMitame](https://github.com/ShigotoMitame)
143 * [@luke-brown](https://github.com/luke-brown)
144
145 ## 1.19.0
146
147 This is a minor dot release and contains library updates ([#334](https://github.com/paupino/rust-decimal/pull/334)) and
148 expanded scope in `prelude` to include `num_traits::Signed` ([#450](https://github.com/paupino/rust-decimal/pull/450)).
149 While subtle, it also expands the way towards some bigger improvements including variable precision.
150
151 Of a larger note, the minimum Rust compiler version has been updated so we can start utilizing various compiler features
152 (such as const generics). The miminum compiler version is now `1.51.0`.
153
154 Thank you to [@c410-f3r](https://github.com/c410-f3r) and [@jracollins](https://github.com/jracollins) for your contributions
155 to this release.
156
157 ## 1.18.0
158
159 * Fixes integer handling for `to_f64` when scale is set to `0`. [#443](https://github.com/paupino/rust-decimal/pull/443).
160 Thank you [@anatols](https://github.com/anatols) for creating this fix.
161 * Add support for Rocket Forms using the feature flag `rocket-traits`. [#445](https://github.com/paupino/rust-decimal/pull/445).
162 Thank you [@Misterio77](https://github.com/Misterio77) for putting this together.
163 * Add Diesel MySQL support, enabled by the feature flag `db-diesel-mysq`. [#446](https://github.com/paupino/rust-decimal/pull/446).
164
165 ## 1.17.0
166
167 * Fixes panic when display precision was specified greater than 30. [#428](https://github.com/paupino/rust-decimal/issues/428).
168 * Binds `deserialize` so that invalid scale values cannot be set. This may be a breaking change for some users leveraging
169 this in a `const` function. [#428](https://github.com/paupino/rust-decimal/issues/428).
170 * Fixes an issue in `round_sf` whereby integral values that started with a 0 or 1 would output incorrect rounded numbers. [#430](https://github.com/paupino/rust-decimal/issues/430), [#437](https://github.com/paupino/rust-decimal/issues/437).
171 * Adds `from_f32_retain` and `from_f64_retain` functions which allow parsing a floating point number and retaining any excess precision. [#438](https://github.com/paupino/rust-decimal/issues/438).
172
173 ## 1.16.0
174
175 * Implement `sin`/`cos`/`tan` functions which are enabled within the `maths` feature. [#413](https://github.com/paupino/rust-decimal/pull/413).
176 * Implement `round_sf` and `round_sf_with_strategy` to enable significant figure rounding. [#421](https://github.com/paupino/rust-decimal/pull/421)
177 * Remove unnecessary `std` feature from `arrayvec` usage [#417](https://github.com/paupino/rust-decimal/pull/417).
178 * Adhoc benchmarking and fuzz tooling improvements [#412](https://github.com/paupino/rust-decimal/pull/412),
179 [#415](https://github.com/paupino/rust-decimal/pull/415), [#416](https://github.com/paupino/rust-decimal/pull/416),
180 [#418](https://github.com/paupino/rust-decimal/pull/418).
181
182 Thank you to [@c410-f3r](https://github.com/c410-f3r) for all your help with fuzz and benchmarking improvements!
183
184 ## 1.15.0
185
186 A minor bug and feature release which adds a couple of new functions as well as cleans up some documentation:
187
188 * Support for serializing to float without converting to float via the `serde-arbitrary-precision` feature.
189 [#402](https://github.com/paupino/rust-decimal/issues/402). Thanks [@JamesHinshelwood](https://github.com/JamesHinshelwood)!
190 for finding and fixing this!
191 * Add `log10` support to the `maths` feature. Please note that `ln` and `log10` will now panic on invalid input since both
192 functions have a `checked_*` equivalent. This is the preferred approach going forward, however if you would like to re-enable
193 the previous behavior please use the `maths-nopanic` feature. [#397](https://github.com/paupino/rust-decimal/issues/397).
194 * Added further constants to the `Decimal` library including `TWO`, `TEN`, `ONE_HUNDRED`, `ONE_THOUSAND`, and `NEGATIVE_ONE`.
195 [#400](https://github.com/paupino/rust-decimal/issues/400).
196 * Fixes serialization issue for `-0` whereby `-` would be output [#406](https://github.com/paupino/rust-decimal/pull/406). Thanks
197 [@edwardycl](https://github.com/edwardycl)!
198 * Fixes float rounding before return in `to_f64`. [#401](https://github.com/paupino/rust-decimal/issues/401).
199 * Added `BUILD.md` file to help people get set up with Rust Decimal locally and cleaned up some
200 documentation examples.
201
202 ## 1.14.3
203
204 Fixes an issue [#398](https://github.com/paupino/rust-decimal/issues/398) where `Decimal::ZERO.ln()` would panic rather than returning `Decimal::ZERO`. This
205 aligns the behavior with calling `ln` on negative decimals.
206
207 Thank you to [@SebRollen](https://github.com/SebRollen) for finding and fixing this.
208
209 ## 1.14.2
210
211 Fixes an overflow issue during division under some specific circumstances. ([#392](https://github.com/paupino/rust-decimal/issues/392))
212
213 ## 1.14.1
214
215 A bug fix release following on from `1.14.0`:
216
217 * Fixes an issue whereby in some cases when subtracting a 64 bit `Decimal` a negating overflow would occur during underflow.
218 [#384](https://github.com/paupino/rust-decimal/issues/384). Thank you to [@c410-f3r](https://github.com/c410-f3r) for finding
219 this as part of fuzz testing.
220 * Fixes an issue with `exp` whereby negative values lost accuracy due to inability to converge.
221 [#378](https://github.com/paupino/rust-decimal/issues/378). Thank you to [@schungx](https://github.com/schungx) for
222 finding this and proposing a fix.
223 * Fixes some documentation issues.
224
225 ## 1.14.0
226
227 * Added `checked_exp` and `checked_norm_pdf` functions [#375](https://github.com/paupino/rust-decimal/pull/375).
228 * Fixes bug in division under certain circumstances whereby overflow would occur during rounding. [#377](https://github.com/paupino/rust-decimal/pull/377)
229 * Documentation improvements
230
231 Thank you to [@falsetru](https://github.com/falsetru), [@schungx](https://github.com/schungx) and [@blasrodri](https://github.com/blasrodri) for your
232 help with this release!
233
234 ## 1.13.0
235
236 This is a minor update to the library providing a few new features and one breaking change (I'm not using semver properly here
237 sorry).
238
239 * `#[must_use]` added to functions to provide additional compiler hints.
240 * `try_from_i128_with_scale` function added to safely handle `i128` overflow errors.
241 * New `c-repr` feature added which will ensure that `#[repr(C)]` is used on the `Decimal` type. Thanks [@jean-airoldie](https://github.com/jean-airoldie).
242 * Small improvements to `from_scientific`. It now supports a wider range of values as well has slightly faster performance.
243 * Support for negative and decimal `pow` functions. This is *breaking* since `powi(u64)` has been renamed to `powi(i64)`. If you want to
244 continue using `u64` arguments then please use `powu(u64)`. The fractional functions should be considered experimental for the time being
245 and may have subtle issues that still need ironing out. Functions are now:
246 * `powi`, `checked_powi` - When the exponent is a signed integer.
247 * `powu`, `checked_powu` - When the exponent is an unsigned integer.
248 * `powf`, `checked_powf` - When the exponent is a floating point number. Please note, numbers with a fractional component
249 will use an approximation function.
250 * `powd`, `checked_powd` - When the exponent is a `Decimal`. Please note, numbers with a fractional component will use
251 an approximation function.
252
253 ## 1.12.4
254
255 Adds `num_traits::One` back to `rust_decimal::prelude` to prevent unnecessary downstream dependency breakages. Thanks [@spearman](https://github.com/spearman).
256
257 ## 1.12.3
258
259 Fixes an issue [#361](https://github.com/paupino/rust-decimal/issues/361) when rounding a small number towards zero.
260
261 ## 1.12.2
262
263 Fixes small regression whereby `0 - 0` was producing `-0`. Thank you [@KonishchevDmitry](https://github.com/KonishchevDmitry) for
264 providing a swift fix ([#356](https://github.com/paupino/rust-decimal/pull/356)).
265
266 ## 1.12.1
267
268 Added `num_traits::Zero` back to `rust_decimal::prelude` to prevent unnecessary downstream dependency breakages.
269
270 ## 1.12.0
271
272 This version releases faster operation support for `add`, `sub`, `cmp`, `rem` and `mul` to match the renewed `div` strategy.
273 It does this by leveraging 64 bit support when it makes sense, while attempting to still keep 32 bit optimizations in place.
274 To ensure correct functionality, thousands more tests were included to cover a wide variety of different scenarios
275 and bit combinations. Compared to previous operations, we get the following speed improvements:
276 * `add` - up to 2.2x faster
277 * `div` - up to 428x faster
278 * `mul` - up to 1.8x faster
279 * `rem` - up to 1.08x faster
280 * `sub` - up to 2.5x faster
281
282 Of course, if old functionality is desired, it can be re-enabled by using the `legacy-ops` feature.
283
284 Other improvements include:
285 * Remove unnecessary `String` allocation when parsing a scientific number format. Thanks [@thomcc](https://github.com/thomcc) for the fix [#350](https://github.com/paupino/rust-decimal/pull/350).
286 * Fixes overflow bug with `sqrt` when using the smallest possible representable number. [#349](https://github.com/paupino/rust-decimal/pull/349).
287 * Some minor optimizations in the `maths` feature. Future work will involve speeding up this feature by keeping operations
288 in an internal format until required.
289 * Added associated constants for `MIN`, `MAX` and `ZERO`. Deprecated `min_value()` and `max_value()` in favor of these new
290 constants.
291 * `-0` now gets corrected to `0`. During operation rewrite I needed to consider operations such as `-0 * 2` - in cases like
292 this I opted towards `0` always being the right number and `-0` being superfluous (since `+0 == -0`). Consequently, parsing
293 `-0` etc _in general_ will automatically be parsed as `0`. Of course, this _may_ be a breaking change so if this
294 functionality is required then please create an issue with the use case described.
295 * Small breaking change by renaming `is_negative` to `negative` in `UnpackedDecimal`.
296 * Some internal housekeeping was made to help make way for version 2.0 improvements.
297
298 ## 1.11.1
299
300 This is a documentation only release and has no new functionality included. Thank you [@c410-f3r](https://github.com/c410-f3r) for the documentation fix.
301
302 ## 1.11.0
303
304 This release includes a number of bug fixes and ergonomic improvements.
305
306 * Mathematical functionality is now behind a feature flag. This should help optimize library size when functions such as
307 `log` and `pow` are not required (e.g. simple financial applications). Mathematical functionality is now behind the `maths`
308 feature flag. [#321](https://github.com/paupino/rust-decimal/pull/321).
309 * Numerous test coverage improvements to ensure broader coverage. [#322](https://github.com/paupino/rust-decimal/pull/322),
310 [#323](https://github.com/paupino/rust-decimal/pull/323)
311 * Various documentation improvements. [#324](https://github.com/paupino/rust-decimal/pull/324), [#342](https://github.com/paupino/rust-decimal/pull/342)
312 * Fixes `u128` and `i128` parsing. [#332](https://github.com/paupino/rust-decimal/pull/332)
313 * Implemented `Checked*` traits from `num_traits`. [#333](https://github.com/paupino/rust-decimal/pull/333). Thank you
314 [@teoxoy](https://github.com/teoxoy)
315 * Added `checked_powi` function to `maths` feature. [#336](https://github.com/paupino/rust-decimal/pull/336)
316 * Updated `from_parts` to avoid accidental scale clobbering. [#337](https://github.com/paupino/rust-decimal/pull/337)
317 * Added support for the `Arbitrary` trait for `rust-fuzz` support. This is behind the feature flag `rust-fuzz`.
318 [#338](https://github.com/paupino/rust-decimal/pull/338)
319 * Fixes `e^-1` returning an incorrect approximation. [#339](https://github.com/paupino/rust-decimal/pull/339)
320 * Revamp of `RoundingStrategy` naming and documentation ([#340](https://github.com/paupino/rust-decimal/pull/340)).
321 The old naming was ambiguous in interpretation - the new naming
322 convention follows guidance from other libraries to ensure an easy to follow scheme. The `RoundingStrategy` enum now
323 includes:
324 * `MidpointNearestEven` (previously `BankersRounding`)
325 * `MidpointAwayFromZero` (previously `RoundHalfUp`)
326 * `MidpointTowardZero` (previously `RoundHalfDown`)
327 * `ToZero` (previously `RoundDown`)
328 * `AwayFromZero` (previously `RoundUp`)
329 * `ToNegativeInfinity` - new rounding strategy
330 * `ToPositiveInfinity` - new rounding strategy
331 * Added function to access `mantissa` directly. [#341](https://github.com/paupino/rust-decimal/pull/341)
332 * Added a feature to `rust_decimal_macros` to make re-exporting the macro from a downstream crate more approachable.
333 Enabling the `reexportable` feature will ensure that the generated code doesn't require `rust_decimal` to be exposed at
334 the root level. [#343](https://github.com/paupino/rust-decimal/pull/343)
335
336 ## 1.10.3
337
338 * Fixes bug in bincode serialization where a negative symbol causes a buffer overflow (#317).
339
340 ## 1.10.2
341
342 * Fixes a bug introduced in division whereby certain values when using a large remainder cause an incorrect results (#314).
343
344 ## 1.10.1
345
346 * Fixes bug introduced in `neg` whereby sign would always be turned negative as opposed to being correctly negated.
347
348 Thank you [KonishchevDmitry](https://github.com/KonishchevDmitry) for finding and fixing this.
349
350 ## 1.10.0
351
352 * Upgrade `postgres` to `0.19` and `tokio-postgres` to `0.7`.
353 * Faster `serde` serialization by preventing heap allocation.
354 * Alternative division algorithm which provides significant speed improvements. The new algorithms are enabled by default,
355 but can be disabled with the feature: `legacy-ops`. Further work to improve other operations will
356 be made available in future versions.
357 * Add `TryFrom` for `f32`/`f64` to/from Decimal
358
359 Thank you for the the community help and support for making this release happen, in particular:
360 [jean-airoldie](https://github.com/jean-airoldie), [gakonst](https://github.com/gakonst), [okaneco](https://github.com/okaneco) and
361 [c410-f3r](https://github.com/c410-f3r).
362
363 ## 1.9.0
364
365 * Added arbitrary precision support for `serde_json` deserialization (#283)
366 * Add `u128` and `i128` `FromPrimitive` overrides to prevent default implementation kicking in. Also adds default `From`
367 interceptors to avoid having to use trait directly. (#282)
368 * Alias `serde-bincode` as `serde-str` to make usage clearer (#279)
369 * Adds scientific notation to format strings via `UpperExp` and `LowerExp` traits. (#271)
370 * Upgrade `tokio-postgres` and `postgres` libraries.
371 * Add statistical function support for `powi`, `sqrt`, `exp`, `norm_cdf`, `norm_pdf`, `ln` & `erf` (#281, #287)
372 * Allow `sum` across immutable references (#280)
373
374 Thank you for all the community help and support with this release, in particular [xilec](https://github.com/xilec),
375 [remkade](https://github.com/remkade) and [Anders429](https://github.com/Anders429).
376
377 ## 1.8.1
378
379 Make `std` support the default to prevent breaking downstream library dependencies. To enable `no_std` support please set
380 default features to false and opt-in to any required components. e.g.
381
382 ```
383 rust_decimal = { default-features = false, version = "1.8.0" }
384 ```
385
386
387 ## 1.8.0
388
389 * `no_std` support added to Rust Decimal by default. `std` isn't required to use Rust Decimal, however can be enabled by
390 using the `std` feature. [#190](https://github.com/paupino/rust-decimal/issues/190)
391 * Fixes issue with Decimal sometimes losing precision through `to_f64`. [#267](https://github.com/paupino/rust-decimal/issues/267).
392 * Add `Clone`, `Copy`, `PartialEq` and `Eq` derives to `RoundingStrategy`.
393 * Remove Proc Macro hack due to procedural macros as expressions being stabilized.
394 * Minor optimizations
395
396 Thank you to [@c410-f3r](https://github.com/c410-f3r), [@smessmer](https://github.com/smessmer) and [@KiChjang](https://github.com/KiChjang).
397
398 ## 1.7.0
399
400 * Enables `bincode` support via the feature `serde-bincode`. This provides a long term fix for a regression
401 that was introduced in version `0.6.5` (tests now cover this case!). [Issue 43](https://github.com/paupino/rust-decimal/issues/43).
402 * Fixes issue where `rescale` on zero would not have an affect. This was due to an early exit condition which failed to
403 set the new scale. [Issue 253](https://github.com/paupino/rust-decimal/issues/253).
404 * Add `min` and `max` functions, similar to what `f32` and `f64` provide. Thank you [@michalsieron](https://github.com/michalsieron).
405 * Updates documentation for `is_sign_positive` and `is_sign_negative` to specify that the sign bit is being checked.
406
407 Please note: feature naming conventions have been modified, however backwards compatible aliases have been created where
408 necessary. It's highly recommended that you move over to the new naming conventions as these aliases may be removed at a
409 later date.
410
411 ## 1.6.0
412
413 * Fixes issue with PostgreSQL conversions whereby certain inputs would cause unexpected
414 outputs. [Issue 241](https://github.com/paupino/rust-decimal/issues/241).
415 * Fixes issue with `from_str_radix` whereby rounding logic would kick in too early,
416 especially with radix less than 10. [Issue 242](https://github.com/paupino/rust-decimal/issues/242).
417 * Fixes issue whereby `from_str` (implicity `from_str_radix`) would panic when there was overflow
418 and overflow significant digit was < 5. [Issue 246](https://github.com/paupino/rust-decimal/issues/246).
419 * Make `bytes` and `byteorder` optional since they're only used in the `postgres` feature and tests.
420 * Fix edge case in `from_i128_with_scale` when `i128::MIN` was provided.
421
422 Thank you to [@serejkaaa512](https://github.com/serejkaaa512), [@AbsurdlySuspicious](https://github.com/AbsurdlySuspicious) and [@0e4ef622]((https://github.com/0e4ef622)) for your contributions!
423
424 ## 1.5.0
425
426 * Added additional `RoundStrategy` abilities: `RoundUp` to always round up and `RoundDown` to always round down.
427 * Updated prelude to include expected structs and traits by default.
428
429 Special thank you to [@jean-airoldie](https://github.com/jean-airoldie) for adding the additional rounding strategies and to [@pfrenssen](https://github.com/pfrenssen) for fixing an
430 issue in the README.
431
432 ## 1.4.1
433
434 * Performance improvements for `to_f64` when using a scale > 0.
435
436 Special thank you to [@hengchu](https://github.com/hengchu) who discovered and resolved the issue!
437
438 ## 1.4.0
439
440 * Allow uppercase "E" in scientific notation.
441 * Allow scientific notation in `dec!` macro.
442 * Deprecate `set_sign` and replace with `set_sign_positive` and `set_sign_negative`. This is intended
443 to improve the readability of the API.
444 * Fixes precision issue when parsing `f64` values. The base 2 mantissa of the float was assuming guaranteed accuracy
445 of 53 bit precision, however 52 bit precision is more accurate (`f64` only).
446 * Removes deprecated usage of `Error::description`.
447
448 ## 1.3.0
449
450 * Replace `num` dependency with `num_trait` - implemented `Signed` and `Num` traits.
451
452 ## 1.2.1
453
454 * Fixes issue whereby overflow would occur reading from PostgreSQL with high precision. The library now
455 handles this by rounding high precision numbers as they're read as opposed to crashing (similar to other
456 underflow situations e.g. 1/3).
457
458 ## 1.2.0
459
460 * Retain trailing zeros from PostgreSQL. This ensures that the scale is maintained when serialized into the Decimal type.
461 * Fixes issue where -0 != 0 (these are now equivalent - thank you @hengchu for discovering).
462 * Improve hashing function so that the following property is true: `k1 == k2 -> hash(k1) == hash(k2)`
463 * Update normalize function so that -0 normalizes to 0.
464
465 Special thanks to @hathawsh for their help in this release!
466
467 ## 1.1.0
468
469 * Update to Postgres 0.17 and add postgres async/await support via `tokio-pg`
470 * Added option for serializing decimals as float via `serde-float`
471
472 Special thanks to @pimeys and @kaibyao!
473
474 ## 1.0.3
475
476 Updates dependencies to prevent build issues.
477
478 ## 1.0.2
479
480 Bug fix release:
481
482 * Fixes issue where scaling logic produced incorrect results when one arm was a high precision zero. Thank you @KonishchevDmitry!
483
484 ## 1.0.1
485
486 Bug fix release:
487
488 * Fixes issue where `ToSql` was incorrectly calculating weight when whole portion = numeric portion.
489 * Fixes issue where `Decimal::new` incorrectly handled `i64::max_value()` and `i64::min_value()`.
490 * Fixes issue where `rem` operation incorrectly returned results when `scale` was required.
491
492 ## 1.0.0
493
494 This release represents the start of semantic versioning and allows the library to start making fundamental improvements under
495 the guise of V2.0. Leading up to that I expect to release 1.x versions which will include adding
496 various mathematical functions such as `pow`, `ln`, `log10` etc.
497
498 Version `1.0.0` does come with some new features:
499
500 * Checked Operations! This implements `checked_add`, `checked_sub`, `checked_mul`, `checked_div` and `checked_rem`.
501 * Fixes overflow from `max_value()` and `min_value()` for `i32` and `i64`.
502 * Minor documentation improvements and test coverage.
503
504 Special thanks to @0e4ef622 for their help with this release!
505
506 ## 0.11.3
507
508 * Add prelude to help num trait inclusion (`use rust_decimal::prelude::*`)
509 * Add `Default` trait to the library. This is equivalent to using `Decimal::zero()`
510 * Added assignment operators for references.
511
512 Special thanks to @jean-airoldie for his help with this release!
513
514 ## 0.11.2
515
516 * Fall back to `from_scientific` when `from_str` fails during deserialization. Thanks @mattjbray!
517 * Added basic `Sum` trait implementation
518
519 ## 0.11.1
520
521 * Fixes a bug in `floor` and `ceil` where negative numbers were incorrectly handled.
522
523 ## 0.11.0
524
525 * Macros are now supported on stable. This does use a [hack](https://github.com/dtolnay/proc-macro-hack) for the meantime
526 so due diligence is required before usage.
527 * Fixes issue when parsing strings where an underscore preceded a decimal point.
528 * `const_fn` support via a feature flag. In the future this will be the default option however in order to support older
529 compiler versions is behind a feature flag.
530
531 ## 0.10.2
532
533 * Macros (nightly) now output structural data as opposed to serialized data. This is fully backwards compatible and results in some minor performance improvements. Also, removed feature gate so that it can be compiled in stable.
534 * Fixes a string parsing bug when given highly significant numbers that require rounding.
535
536 ## 0.10.1
537
538 * Bumped dependencies to remove some legacy serialization requirements.
539
540 ## 0.10.0
541
542 Special thanks to @xilec, @snd and @AndrewSpeed for their help with this release.
543
544 * New rounding strategies introduced via `round_dp_with_strategy`. Previously default rounding support used bankers rounding by default whereas now you can choose to round the half way point either up or down.
545 * PostgreSQL write performance improved so that it is at least 3 times faster than the previous implementation.
546 * `Debug` trait now outputs the actual decimal number by default to make it more useful within consuming libraries (e.g. `criterion.rs`). To get something similar to the previous functionality you can use the `unpack` argument - this is likely for core `rust-decimal` library maintainers.
547 * Various other performance improvements for common operations such as `rescale`, `sub` and `div`.
548
549 ## 0.9.1
550
551 * Performance optimization for `add`.
552
553 ## 0.9.0
554
555 * Introduces the `Neg` trait to support the ability to use `-decimal_variable`.
556 * Fixes bug with underflow on addition.
557
558 ## 0.8.1
559
560 This release updates the published documentation only and is a no-op for functionality.
561
562 ## 0.8.0
563
564 * Introduces `from_scientific` allowing parsing of scientific notation into the Decimal type.
565 * Fixes a bug when formatting a number with a leading zero's.
566
567 ## 0.7.2
568
569 * Fixes bug in `rescale` whereby scaling which invoked rounding incorrectly set the new scale for the left/right sides.
570
571 ## 0.7.1
572
573 * Fixes bug in `cmp` whereby two negatives would return an incorrect result.
574 * Further documentation examples
575 * Small improvements in division logic
576 * New `abs`, `floor` and `ceil` functions.
577
578 ## 0.7.0
579
580 This is a minor version bump as we slowly build our way towards 1.0. Thank you for everyone's support and help as we get there! This has a few notable changes - also introducing a few new interfaces which is the reason for the version bump:
581
582 * `from_parts` function to allow effective creation of `Decimal`'s without requiring binary serialization. An example of this benefit is with the lazy static group initializers for Postgres.
583 * `normalize` function to allow stripping trailing zero's easily.
584 * `trunc` function allows truncation of a number without any rounding. This effectively "truncates" the fractional part of the number.
585 * `fract` function returns the fractional part of the number without the integral.
586 * Minor improvements in some iterator logic, utilizing the compiler for further optimizations.
587 * Fixes issue in string parsing logic whereby `_` would cause numbers to be incorrectly identified.
588 * Many improvements to `mul`. Numbers utilizing the `lo` portion of the decimal only will now be shortcut and bigger numbers will now correctly overflow. True overflows will still panic, however large underflows will now be rounded as necessary as opposed to panicing.
589 * `Hash` was implemented by convention in `0.6.5` however is reimplemented explicitly in `0.7.0` for effectiveness.
590 * PostgreSQL read performance improved by pre-caching groups and leveraging `normalize` (i.e. avoiding strings). Further optimizations can be made in write however require some `div` optimizations first.
591 * Added short circuit write improvement for zero in PostgreSQL writes.
592 * Benchmarks are now recorded per build so we can start tracking where slow downs have occurred. This does mean there is a performance hit on Travis builds however hopefully the pay off will make it worthwhile.
593
594 ## 0.6.5
595
596 Fixes issue with rescale sometimes causing a silent overflow which led to incorrect results during addition, subtraction and compare. Consequently Decimal now rounds the most significant number so that these operations work successfully.
597
598 In addition, Decimal now derive's the `Hash` trait so that it can be used for indexing.
599
600 ## 0.6.4
601
602 Fixes silent overflow errors when parsing highly significant strings. `from_str` will now round in these scenario's, similar to oleaut32 behavior.
603
604 ## 0.6.3
605
606 Fixes a regression in ordering where by different scales would be rescaled towards losing precision instead of increasing precision. Have added numerous test suites to help cover more issues like this in the future.
607 Also fixes an issue in parsing invalid strings whereby the precision exceeded our maximum precision. Previously, this would work with unintended results however this now returns an Error returned from `FromStr`.
608
609 ## 0.6.2
610
611 Fixes an issue with division of rational numbers allowing results greater than `MAX_PRECISION`. This would ultimately cause issues for future operations on this number.
612 In addition, in some cases transitive operations would not be equal due to overflow being lost.
613
614 ## 0.6.1
615
616 This minor release is purely to expose `rust_decimal_macros` for use on the nightly channel. Documentation has been updated accordingly.
617
618 ## 0.6.0
619
620 This release has a few major changes to the internal workings of the `Decimal` implementation and consequently comes with a number of performance improvements.
621
622 * Floats can now be parsed into a `Decimal` type using `from_f32` and `from_f64`.
623 * `add`, `sub`, `mul` run roughly 1500% faster than before.
624 * `div` run's roughly 1000% faster than before with room for future improvement.
625 * Also get significant speed improvements with `cmp`, `rescale`, `round_dp` and some string manipulations.
626 * Implemented `*Assign` traits for simpler usage.
627 * Removed `BigInt` and `BigUint` as being intermediary data types.
628
629 ## 0.5.2
630
631 Minor bug fix to prevent a `panic` from overflow during comparison of high significant digit decimals.
632
633 ## 0.5.1
634
635 Minor bux fix to prevent `panic` upon parsing an empty string.
636
637 ## 0.5.0
638
639 * Removes postgres from default feature set.
640 * `bincode` support for serde
641 * Better support for format strings
642 * Benchmarks added to tests
643
644 ## 0.4.2
645
646 Fixes bug in `cmp` whereby negative's were not being compared correctly.
647
648 ## 0.4.1
649
650 Minor bug fix to support creating negative numbers using the default constructor.
651
652 ## 0.4.0
653
654 This release is a stylistic cleanup however does include some minor changes that may break existing builds.
655
656 ### Changed
657 * Serde is now optional. You can enable Serde support within `features` using the keyword `serde`.
658 * Serde now returns errors on invalid input as opposed to `0`.
659 * `f64` conversion support has been added.
660 * Update Postgres dependency to use v0.15.
661
662 ## 0.3.1
663
664 This is a documentation release that should help with discoverability and usage.
665
666 ## 0.3.0
667
668 ### Changed
669 * Removed trait `ToDecimal` and replaced with builtin [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) trait ([`#12`](https://github.com/paupino/rust-decimal/pull/12))