From: Krzysztof K. <twe...@gm...> - 2013-09-29 04:21:13
|
2013/9/28 Johan Engelen <jbc...@sw...>: > Hi all, > Point::isZero is using float point comparison instead of are_near. > Any objections against changing this to are_near? > The new code: > bool isZero() const { > return ( are_near(_pt[X],0) && are_near(_pt[Y],0) ); > } 1. The method is called isZero() rather than isNearZero() for a reason. There are cases when checking for exact equality is the right thing to do. 2. Every method that tests for nearness must take an epsilon parameter. You must never call are_near with the default epsilon parameter within lib2geom. Regards, Krzysztof |