2 Answered Questions for the topic floating accuracy

Floating Accuracy C Ios Floating Point


How dangerous is it to compare floating point values?

I know `UIKit` uses `CGFloat` because of the resolution independent coordinate system.But every time I want to check if for example `frame.origin.x` is `0` it makes me feel sick: if... more


Is floating point math broken?

Consider the following code:<!-- language: lang-js --> 0.1 + 0.2 == 0.3 -> false<!-- language: lang-js --> 0.1 + 0.2 -> 0.30000000000000004 Why do these... more

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.