Skip to content

Commit aaedc4e

Browse files
Sijabcardiff
authored andcommittedNov 18, 2017
Implement BigDecimal followup (#5255)
* Remove unnecessary “src/big_decimal.cr” * Make `BigDecimal` descendant of `Number` * Add forward declaration for `BigDecimal`
1 parent 1b95a69 commit aaedc4e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed
 

‎spec/std/big/big_decimal_spec.cr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require "spec"
2-
require "big_decimal"
2+
require "big"
33

44
describe BigDecimal do
55
it "initializes from valid input" do

‎src/big.cr

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ end
88
struct BigRational < Number
99
end
1010

11+
struct BigDecimal < Number
12+
end
13+
1114
require "./big/lib_gmp"
1215
require "./big/big_int"
1316
require "./big/big_float"

‎src/big/big_decimal.cr

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
require "big"
2-
31
# A `BigDecimal` represents arbitrary precision decimals.
42
#
53
# It is internally represented by a pair of `BigInt` and `UInt64`: value and scale.
@@ -15,7 +13,7 @@ class InvalidBigDecimalException < Exception
1513
end
1614
end
1715

18-
struct BigDecimal
16+
struct BigDecimal < Number
1917
ZERO = BigInt.new(0)
2018
TEN = BigInt.new(10)
2119
DEFAULT_MAX_DIV_ITERATIONS = 100_u64

‎src/big_decimal.cr

-1
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.