Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17116

Floating point compare?

$
0
0

@shipit wrote:

hey guys, what's the proper way to do floating point compare?

this:

if (rect1.getMinX() == rect2.getMinX() {
// do something
}

or:

if (fabsf(rect1.getMinX() - rect2.getMinX()) == FLT_EPSILON) {
// do something
}

??

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>