matheusmello.io
BlogProduct ReleasesToolsBooksContact

floating-accuracy

How dangerous is it to compare floating point values?
c#
September 2, 20231 min read

How dangerous is it to compare floating point values?

# How Dangerous is it to Compare Floating Point Values? 😱 ## The Issue 😕 You're working with `UIKit`, using `CGFloat` to handle resolution-independent coordinate systems. But when you need to check if a value is equal to another, like `frame.origin.x =

c#floating-accuracyfloating-point
Why are these numbers not equal?
floating-accuracy
September 2, 20231 min read

Why are these numbers not equal?

# Why are these numbers not equal? 😕 You might be scratching your head, wondering why the numbers in the code above are not equal. It seems straightforward, right? 0.1 plus 0.05 should equal 0.15. 🤔 But hold on, things are not always as they appear in

floating-accuracyfloating-pointr
+1

About

Personal blog sharing insights on software engineering, technology, and developer productivity.

TwitterGitHubLinkedInEmail

Tags

Loading tags...

Subscribe to Updates

Get the latest posts delivered right to your inbox.

© 2025 MatheusMello.io. All rights reserved.