Skip to content

Commit

Permalink
Merge pull request #8 from rodineijf/main
Browse files Browse the repository at this point in the history
Added zero value constant
  • Loading branch information
comigor authored Mar 15, 2022
2 parents 73d35ec + a1c031b commit 19a2678
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 0.4.0
- Add `zero`, `one` and `two` static values: e.g. `BigDecimal.zero`

## 0.3.1
- Add missing hashCode implementation ~aka remove feature where all BigDecimals were different~

Expand Down
4 changes: 4 additions & 0 deletions lib/src/big_decimal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class BigDecimal implements Comparable<BigDecimal> {
);
}

static BigDecimal zero = BigDecimal.fromBigInt(BigInt.zero);
static BigDecimal one = BigDecimal.fromBigInt(BigInt.one);
static BigDecimal two = BigDecimal.fromBigInt(BigInt.two);

static int nextNonDigit(String value, [int start = 0]) {
var index = start;
for (; index < value.length; index++) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: big_decimal
version: 0.3.1
version: 0.4.0
description: >
A bugless implementation of BigDecimal in Dart based on Java's BigDecimal
Expand Down

0 comments on commit 19a2678

Please sign in to comment.