boostorg / boostorg/polygon

detail/voronoi_robust_fpt.hpp

Open
#48 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
70
Forks
75
PR merge metrics
No merged PRs in 30d

Description

Доброе время суток.

Коллеги из соседнего отдела нашли особенность, там деление на 0 происходит.

182 строка
```
robust_fpt operator-(const robust_fpt& that) const {
floating_point_type fpv = this->fpv_ - that.fpv_;
relative_error_type re;
if ((!is_neg(this->fpv_) && !is_pos(that.fpv_)) ||
(!is_pos(this->fpv_) && !is_neg(that.fpv_))) {
re = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
} else {
floating_point_type temp =
0; //
if (fpv != 0) // этот случай в библиотеке не обработан
temp = //
(this->fpv_ * this->re_ + that.fpv_ * that.re_) / fpv;
if (is_neg(temp))
temp = -temp;
re = temp + ROUNDING_ERROR;
}
return robust_fpt(fpv, re);
}
```
Сможете посмотреть и поправить?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.