NSSet: should I use float / double in NSSet?

As we know, when comparing floating point numbers, there is a problem with the number of floating point numbers.

In addition, NSSet uses equality for comparison to preserve unique elements in it.

So what happens when an NSSet stores NSValues ​​that have float / double in it,

Should we never use float in NSSet to avoid float accuracy problem?

+4
source share
1 answer

when comparing floating point numbers, there is the problem of the accuracy of the number of floating point numbers.

, . , , NSSet.

, , NSSet NSValues, float/double ?

, , . NSSet. , .

+4

All Articles