detail/voronoi_robust_fpt.hpp

Open
#48 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

Start with detail/voronoi_robust_fpt.hpp around line 182 and inspect robust_fpt::operator-(). Determine the intended behavior when fpv is zero and verify the change against the reported division-by-zero case. Done means subtraction no longer divides by zero while preserving the robust floating-point result.

Written by the indexing model from the issue text.

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);
  }

Сможете посмотреть и поправить?

Dominant language
C++
Stars
70
Forks
76
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/polygon

All issues in boostorg/polygon

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.