Skip to content

Commit

Permalink
Implement BigDecimal followup (#5255)
Browse files Browse the repository at this point in the history
* Remove unnecessary “src/big_decimal.cr”

* Make `BigDecimal` descendant of `Number`

* Add forward declaration for `BigDecimal`
  • Loading branch information
Sija authored and bcardiff committed Nov 18, 2017
1 parent 1b95a69 commit aaedc4e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion spec/std/big/big_decimal_spec.cr
@@ -1,5 +1,5 @@
require "spec"
require "big_decimal"
require "big"

describe BigDecimal do
it "initializes from valid input" do
Expand Down
3 changes: 3 additions & 0 deletions src/big.cr
Expand Up @@ -8,6 +8,9 @@ end
struct BigRational < Number
end

struct BigDecimal < Number
end

require "./big/lib_gmp"
require "./big/big_int"
require "./big/big_float"
Expand Down
4 changes: 1 addition & 3 deletions src/big/big_decimal.cr
@@ -1,5 +1,3 @@
require "big"

# A `BigDecimal` represents arbitrary precision decimals.
#
# It is internally represented by a pair of `BigInt` and `UInt64`: value and scale.
Expand All @@ -15,7 +13,7 @@ class InvalidBigDecimalException < Exception
end
end

struct BigDecimal
struct BigDecimal < Number
ZERO = BigInt.new(0)
TEN = BigInt.new(10)
DEFAULT_MAX_DIV_ITERATIONS = 100_u64
Expand Down
1 change: 0 additions & 1 deletion src/big_decimal.cr

This file was deleted.

0 comments on commit aaedc4e

Please sign in to comment.