I’m trying to find a way to figure out whether or not there is a NaN (not a number) component in a CFrame. I’ve created a few solutions, however, I don’t think they’re the best they can be. The first problem was that when you try to get the type of a variable that is NaN, it will tell you it’s a number:

```
print(math.asin(2)) --> nan
print(type(math.asin(2))) --> number
```

Since there’s no unique type I attempted a few other solutions

```
local function HasNaNComponent(cframe)
return tostring(cframe:GetComponents()):find("nan") ~= nil
end
print(HasNaNComponent(CFrame.new(math.asin(2), 0, 0))) --> true
print(HasNaNComponent(CFrame.new(1, 0, 0))) --> false
```

This was giving me the correct result, however, turning the components into one big string felt like an unnecessary step, so I tried looping through the components. Apparently, two NaN values are not equal to each other, even when you use the same method to get both values, for example, math.asin(2) ~= math.asin(2).

```
local function HasNaNComponent(cframe)
for _, component in pairs{cframe:GetComponents()} do
if component ~= component then
return true
end
end
return false
end
```

This function yielded the same results as the previous one. However, there’s a problem with this one as well, I need to turn the components into a table. Is it at all possible to avoid creating tables or strings to get the result I’m looking for?