-
Out of Cash – Next American City
When former California Governor Jerry Brown became mayor of Oakland some 16 years after leaving statewide office, he pledged to add 10,000 residents to the city’s downtown. Had Brown been the mayor of, say, booming Plano or Aurora, he could have spent his first term back at the Buddhist monastery where he once lived and the city would have reached that goal of its own accord.
-
objective c - How dangerous is it to compare floating point values? - Stack Overflow
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 (theView.frame.origin.x == 0) {
// do important operation
}
Isn't CGFloat vulnerable to false positives when comparing with ==, <=, >=, <, >? It is a floating point and they have unprecision problems: 0.0000000000041 for example.
Is Objective-C handling this internally when comparing or can it happen that a origin.x which reads as zero does not compare to 0 as true? -
http://www.cs.princeton.edu/~rs/talks/AlgsMasses.pdf
ALgorithms for the Masses
-
giving.code where programmers help
→ are you a charity, scientist or engineer in need of programming help?
→ are you a programmer who wants to spend just five minutes helping make the world a better place?
Tuesday, May 15, 2012
load01 05/15/2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment