---
title: "XCTAssertNotEqual(_:_:accuracy:_:file:line:)"
framework: xctest
role: symbol
role_heading: Function
path: "xctest/xctassertnotequal(_:_:accuracy:_:file:line:)-7jcd6"
---

# XCTAssertNotEqual(_:_:accuracy:_:file:line:)

Asserts that two floating-point values aren’t equal within a specified accuracy.

## Declaration

```swift
func XCTAssertNotEqual<T>(_ expression1: @autoclosure () throws -> T, _ expression2: @autoclosure () throws -> T, accuracy: T, _ message: @autoclosure () -> String = "", file: StaticString = #filePath, line: UInt = #line) where T : FloatingPoint
```

## Parameters

- `expression1`: An expression of type T, where T conforms to doc://com.apple.documentation/documentation/Swift/FloatingPoint.
- `expression2`: A second expression of type T, where T conforms to doc://com.apple.documentation/documentation/Swift/FloatingPoint.
- `accuracy`: An expression of type T, where T conforms to doc://com.apple.documentation/documentation/Swift/FloatingPoint. This parameter describes the maximum difference between expression1 and expression2 for these values to be considered not equal.
- `message`: An optional description of a failure.
- `file`: The file where the failure occurs. The default is the filename of the test case where you call this function.
- `line`: The line number where the failure occurs. The default is the line number where you call this function.

## Discussion

Discussion expression1, expression2, and accuracy must all be of the same type T, and type T must conform to FloatingPoint.

## See Also

### Tests for Equality Within a Specified Accuracy

- [XCTAssertEqual(_:_:accuracy:_:file:line:)](xctest/xctassertequal(_:_:accuracy:_:file:line:)-6frfw.md)
- [XCTAssertEqual(_:_:accuracy:_:file:line:)](xctest/xctassertequal(_:_:accuracy:_:file:line:)-4epu5.md)
- [XCTAssertNotEqual(_:_:accuracy:_:file:line:)](xctest/xctassertnotequal(_:_:accuracy:_:file:line:)-326vc.md)
