<!--
{
  "availability" : [
    "*: -"
  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTAssertNotEqualWithAccuracy(_:_:_:_:file:line:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "s:6XCTest29XCTAssertNotEqualWithAccuracy____4file4lineyxyKXK_xyKXKxSSyXKs12StaticStringVSutSFRzlF"
  },
  "title" : "XCTAssertNotEqualWithAccuracy(_:_:_:_:file:line:)"
}
-->

# XCTAssertNotEqualWithAccuracy(_:_:_:_:file:line:)

Asserts that two values are not equal within a certain accuracy.

```
func XCTAssertNotEqualWithAccuracy<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`

An 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>. Describes the maximum difference between `expression1` and `expression2` for these values to be considered not equal.

`message`

An optional description of the failure.

`file`

The file in which failure occurred. Defaults to the file name of the test case in which this function was called.

`line`

The line number on which failure occurred. Defaults to the line number on which this function was called.

## Discussion

`expression1`, `expression2`, and `accuracy` must all be of the same type `T` that conforms to <doc://com.apple.documentation/documentation/Swift/FloatingPoint>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)