Skip to content

Commit

Permalink
Add Float16 tests for Approximate Equality.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentyrone committed Jul 27, 2020
1 parent 13b74ae commit 4cd1155
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/RealTests/ApproximateEqualityTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ final class ElementaryFunctionTests: XCTestCase {
}
}

@available(iOS 14.0, watchOS 14.0, tvOS 7.0, *)
@available(macOS, unavailable)
@available(macCatalyst, unavailable)
func testFloat16() {
testSpecials(Float16.self)
testDefaults(Float16.self)
testRandom(Float16.self)
}

func testFloat() {
testSpecials(Float.self)
testDefaults(Float.self)
Expand Down
5 changes: 5 additions & 0 deletions Tests/RealTests/RealTestSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ internal protocol FixedWidthFloatingPoint: BinaryFloatingPoint
where Exponent: FixedWidthInteger,
RawSignificand: FixedWidthInteger { }

@available(iOS 14.0, watchOS 14.0, tvOS 7.0, *)
@available(macOS, unavailable)
@available(macCatalyst, unavailable)
extension Float16: FixedWidthFloatingPoint { }

extension Float: FixedWidthFloatingPoint { }
extension Double: FixedWidthFloatingPoint { }
#if (arch(i386) || arch(x86_64)) && !os(Windows) && !os(Android)
Expand Down

0 comments on commit 4cd1155

Please sign in to comment.