From a49e6fdc2779f4427549b784f8f6c72d3cffdbce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 1 Nov 2017 13:45:21 +0100 Subject: [PATCH] Update Approx documentation --- docs/assertions.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/assertions.md b/docs/assertions.md index 3a9d898e..93f88c41 100644 --- a/docs/assertions.md +++ b/docs/assertions.md @@ -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::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