<div dir="ltr">For now I only need this functionality in unit tests. I found an assertion for that. Here is what works for case where the variable `c` refers to a `VCircle` object from a class I defined:<div><br></div><div><font face="monospace"> self assert: c area isCloseTo: 28.2743339.</font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2024 at 10:26 AM H. Fernandes via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Would be nice to have within DrGeo, especially when computing locus <br>
<br>
Dr. Geo -- <a href="http://gnu.org/s/dr-geo" rel="noreferrer" target="_blank">http://gnu.org/s/dr-geo</a><br>
<br>
----- ken.dickey--- via Cuis-dev &<a href="mailto:lt%3Bcuis-dev@lists.cuis.st" target="_blank">lt;cuis-dev@lists.cuis.st</a>&gt; a écrit :<br>
> On 2024-06-03 16:36, Mark Volkmann via Cuis-dev wrote:<br>
> <br>
> > Is there a function that tests whether two Float values are "close" <br>
> > (within some delta)?<br>
> <br>
> Really, it depends on what you expect to use numbers for.<br>
> <br>
> Numerical methods using Floats are frequently unstable and "the wrong <br>
> answer fast".<br>
> <br>
> <a href="https://people.cs.pitt.edu/~cho/cs1541/current/handouts/goldberg.pdf" rel="noreferrer" target="_blank">https://people.cs.pitt.edu/~cho/cs1541/current/handouts/goldberg.pdf</a><br>
> <br>
> Various strategies have been devised to make numerical calculations more <br>
> robust.<br>
> <br>
> One simple idea, used in several systems such as Mathematica, is to keep <br>
> the highest and lowest possible values a function computes and carry the <br>
> calculation of values throughout a calculation. You then expect the <br>
> "exact" value to be within this interval.<br>
> <br>
> <a href="https://en.wikipedia.org/wiki/Interval_arithmetic" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Interval_arithmetic</a><br>
> <br>
> If the interval is small, you may have a high confidence in a close <br>
> result. If the "answer" is a humongous interval, you better do the <br>
> error analysis.<br>
> <br>
> An interesting variant of this is Ball Arithmetic, where the answer is <br>
> not an interval but lives within a (potentially multidimensional) <br>
> hypersphere.<br>
> <br>
> <a href="https://www.texmacs.org/joris/ball/ball.html" rel="noreferrer" target="_blank">https://www.texmacs.org/joris/ball/ball.html</a><br>
> <br>
> NB: I am not mathematician enough to evaluate Ball Arithmetic.<br>
> <br>
> I have used Interval Arithmetic for some cases. Interestingly, there <br>
> was an Apple function grapher which used Interval Arithmetic to <br>
> automatically calculate function values to the required precision. This <br>
> meant that you could look at f(x) = x * sin(x) near zero, and keep <br>
> "inzooming" to smaller and smaller ranges and still see an accurate <br>
> graph of this "squiggle function".<br>
> <br>
> There are some very interesting discussions about real numbers -- and <br>
> holes between them -- in Lakoff & Nunez's _Where Mathematics Comes From_<br>
> <br>
> HTH,<br>
> -KenD<br>
> -- <br>
> Cuis-dev mailing list<br>
> <a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
> <a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
<br>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>