mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-15 10:19:54 +01:00
Update Approx documentation
This commit is contained in:
parent
accf9859b4
commit
a49e6fdc27
@ -64,7 +64,7 @@ This way `Approx` is constructed with reasonable defaults, covering most simple
|
||||
|
||||
* __epsilon__ - epsilon serves to set the percentage by which a result can be erroneous, before it is rejected. By default set to `std::numeric_limits<float>::epsilon()*100`.
|
||||
* __margin__ - margin serves to set the the absolute value by which a result can be erroneous before it is rejected. By default set to `0.0`.
|
||||
* __scale__ - scale serves to adjust the base for comparison used by epsilon, can be used when By default set to `1.0`.
|
||||
* __scale__ - scale serves to adjust the epsilon's multiplicator. By default set to `0.0`.
|
||||
|
||||
#### epsilon example
|
||||
```cpp
|
||||
@ -84,7 +84,12 @@ Approx target = Approx(100).margin(5);
|
||||
```
|
||||
|
||||
#### scale
|
||||
Scale can be useful if the computation leading to the result worked on different scale, than is used by the results (and thus expected errors are on a different scale than would be expected based on the results alone).
|
||||
Scale can be useful if the computation leading to the result worked
|
||||
on different scale than is used by the results. Since allowed difference
|
||||
between Approx's value and compared value is based primarily on Approx's value
|
||||
(the allowed difference is computed as
|
||||
`(Approx::scale + Approx::value) * epsilon`), the resulting comparison could
|
||||
need rescaling to be correct.
|
||||
|
||||
|
||||
## Exceptions
|
||||
|
Loading…
Reference in New Issue
Block a user