catchorg / catchorg/Catch2

floating point matchers for std::complex<T>

Open
#2,701 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

**Description**
Describe the feature/change you request and why do you want it.

Our [application](https://github.com/QMCPACK/qmcpack) needs to compare complex numbers for equality. We created a [ComplexApprox class](https://github.com/QMCPACK/qmcpack/blob/2db0b25e4ad64b06f11cfb5ba9644c553094571a/external_codes/catch/complex_approx.hpp) to provide this functionality.

```
std::complex i(0.,1.), j(0.,1.);
CHECK(i == ComplexApprox(j));
```

We want to make an upstream contribution. Since [Approx is deprecated](https://github.com/catchorg/Catch2/issues/1444) could a custom matcher provide the same functionality? Is such a pull request likely to be accepted?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.