diff --git a/Sources/BigInt/BigInt.swift b/Sources/BigInt/BigInt.swift index b24ba70..82f10db 100644 --- a/Sources/BigInt/BigInt.swift +++ b/Sources/BigInt/BigInt.swift @@ -89,26 +89,6 @@ extension BigInt: Comparable { } } -extension BigInt: CustomStringConvertible { - - public var description: String { - var result = "" - - if words.count == 1 { - return Int64(bitPattern: UInt64(words[0])).description - } else { - var next = abs(self) - while next != 0 { - let digit: BigInt - (next, digit) = BigInt._div(lhs: next, rhs: 10) - result += "\(digit.words[0])" - } - } - - return (self < 0 ? "-" : "") + String(result.reversed()) - } -} - extension BigInt: LosslessStringConvertible { public init?(_ description: String) { diff --git a/Tests/BigIntTests/BigIntTests.swift b/Tests/BigIntTests/BigIntTests.swift index e860f67..ddbeff1 100644 --- a/Tests/BigIntTests/BigIntTests.swift +++ b/Tests/BigIntTests/BigIntTests.swift @@ -112,6 +112,11 @@ final class BigIntTests: XCTestCase { XCTAssertEqual(baz, bar) } + func testThing() { + let foo = BigInt("-1234567890123456789012345678901234567890")! + XCTAssertTrue(foo != 0) + } + func testComparable() { let foo = BigInt("1234567890123456789012345678901234567890")! let bar = foo * foo