# Does x.isNaN == (x != x)?

**URL:** <https://forums.swift.org/t/does-x-isnan-x-x/53486>\
**Category:** Using Swift\
**Created:** [November 14, 2021, 7:12pm UTC](https://forums.swift.org/t/does-x-isnan-x-x/53486 "2021-11-14T19:12:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![RonAvitzur](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ronavitzur/32/13927_2.png) [@RonAvitzur](https://forums.swift.org/u/RonAvitzur)\
**Post date:** [November 14, 2021, 7:48pm UTC](https://forums.swift.org/t/does-x-isnan-x-x/53486/3 "2021-11-14T19:48:39Z")

</div>

> [@AlexanderM](#):
>
> ```swift
> @inlinable // FIXME(inline-always)
> public var isNaN: Bool {
> @inline(__always)
> get {
> return !isFinite && significandBitPattern != 0
> }
> }
>           
> 
> ```

Thank you. That "fixes" the issue with it not being inlined in the specialization. Though, as discussed in [When should both @inlinable and @inline(\_\_always) be used? - #2 by scanon](https://forums.swift.org/t/when-should-both-inlinable-and-inline-always-be-used/37375/2), I need to consider whether the particular test case I'm looking at is representative or whether the code expansion of forcing inline will hurt performance elsewhere.

---

_[View the full topic](https://forums.swift.org/t/does-x-isnan-x-x/53486)._
