Skip to content

Commit da1e6de

Browse files
committed
Fixed test
1 parent 7a25cd2 commit da1e6de

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

Sources/Euler/Extensions/Array.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public extension Array {
6565
/// - step: The step the function will use to generate the array
6666
/// - offset: The offset you want to use to generate your array
6767
static func arange(start: Double, end: Double, step: Double = 1, offset: Double = 0) -> [Double] {
68-
let len = (abs(end - start) + (offset * 2)) / step + 1
68+
let len = (abs(end - start) + (offset * 2)) / step + Double(1)
6969
let direction: Double = start < end ? 1 : -1
7070
let startingPoint = start - (direction * offset)
7171
let stepSize = direction * step

Tests/EulerTests/AlgebraTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class AlgebraTests: XCTestCase {
2424

2525
// Roots
2626
let golden = try! Polynomial(1, -1, -1)
27-
XCTAssertEqual(golden.roots.last, 102334155/63245986) // Golden Ratio, simplified
27+
28+
XCTAssertEqual(golden.roots.last, BN(102334155, over: 63245986)) // Golden Ratio, simplified
2829

2930
let higher = try! Polynomial(1, 2, -25, -26, 120)
3031
let roots = higher.roots

Tests/EulerTests/BigIntTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class BigIntTests: XCTestCase {
141141
// MARK: Gamma
142142
XCTAssertEqual(try? factorial(3), 6)
143143
XCTAssertEqual(try? factorial(11), 39916800)
144-
XCTAssertEqual(try? gamma(3 / 2).nearlyEquals(0.8862269254527576), true)
144+
XCTAssertEqual(try? gamma(BN(3, over: 2)).nearlyEquals(0.8862269254527576), true)
145145
// MARK: Logarithms
146146
XCTAssert(ln(15).nearlyEquals(2.708050201102210))
147147

Tests/EulerTests/TablesTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TablesTests: XCTestCase {
2424

2525
func testEngineering() {
2626
let t = Tables()
27-
XCTAssertEqual(try t.CONVERT(28, from_unit: "km/h", to_unit: "m/s"), 70/9)
27+
XCTAssertEqual(try t.CONVERT(28, from_unit: "km/h", to_unit: "m/s"), BigDouble(70, over: 9))
2828
}
2929

3030
static var allTests = [

0 commit comments

Comments
 (0)