Open
Description
I have implemented a wrapper class for use in a set of mathemetical calculations I am experimenting with. I am trying to present an arbitrary math set of tools largely because IEEE standards introduce many approximations. So I have been unit testing the use of BDouble to support my needs, and i have found several use cases where BDouble loops infinitely. one such use case is the square root of 1024000.0. My unit test is very simple.
func testSqrt1MPure() {
BDouble.precision = 30
let testcase = BDouble("1024000")!
let testResult = testcase.nthroot(2)
XCTAssert(testResult - BDouble("1011.92885125388138623964593421847026868")! < Double.ulpOfOne, "testcase5 = testResult.decimalExpansion(precisionAfterDecimalPoint: 30))")
}
Metadata
Metadata
Assignees
Labels
No labels