Пример #1
0
bool Rectangle::pointInside(const Point2D& point) const {
	double px = point.getX();
	double py = point.getY();
	return (((px >= this->x || doublesEqual(px, this->x)) &&
			 (px <= this->x+this->w || doublesEqual(px, this->x+this->w))) &&
			((py >= this->y || doublesEqual(py, this->y)) &&
			 (px <= this->y+this->h || doublesEqual(py, this->y+this->h))));
}
Пример #2
0
int numbsEqual(Numb x, Numb y){
#ifdef INT_COEFFS
    return x == y;
#else
    return doublesEqual((double)x, (double)y);
#endif
}