Skip to content

Commit fee4f0c

Browse files
committed
Revert "Use _MaxBuiltinFloatType instead of our own type."
This reverts commit 714c9ca4bc0269d49d198bfd396118410c8ba178.
1 parent b54b8a6 commit fee4f0c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/stdlib/tgmath.swift.gyb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,25 @@
2222
import Glibc
2323
#endif
2424

25+
#if (arch(i386) || arch(x86_64)) && !os(Windows)
26+
typealias TestLiteralType = Float80
27+
#else
28+
typealias TestLiteralType = Double
29+
#endif
30+
2531
import StdlibUnittest
2632

2733
let MathTests = TestSuite("TGMath")
2834

29-
func expectEqualWithTolerance<T>(_ expected: _MaxBuiltinFloatType, _ actual: T,
35+
func expectEqualWithTolerance<T>(_ expected: TestLiteralType, _ actual: T,
3036
ulps allowed: T = 3,
3137
file: String = #file, line: UInt = #line)
3238
where T: BinaryFloatingPoint {
3339
if actual == T(expected) || actual.isNaN && expected.isNaN {
3440
return
3541
}
3642
// Compute error in ulp, compare to tolerance.
37-
let absoluteError = T(abs(_MaxBuiltinFloatType(actual) - expected))
43+
let absoluteError = T(abs(TestLiteralType(actual) - expected))
3844
let ulpError = absoluteError / T(expected).ulp
3945
expectTrue(ulpError <= allowed,
4046
"\(actual) != \(expected) as \(T.self)" +

0 commit comments

Comments
 (0)