Hi !
Some of our user reported an error in CurvFitt.pas.
Function TCustomTrendFunction.Coefficient
.....
tmpDenominator:=Sqrt( (SumX2 - SumX*SumX/ICount) * (SumY2 - SumY*SumY/ICount) );
I checked this code and figured out that in a usercase the result of
(SumX2 - SumX*SumX/ICount) * (SumY2 - SumY*SumY/ICount)
is -6,4670491184e-12
And if you use sqrt then you will get something like this:
Ungültige Fließkommaausführung bei 004037AA
(EInvalidOp)
How can we correct this problem?
btw. We use still version 8.02
Greetz Dominik
Error in CurvFitt.pas
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Dominik,
I'm not able to reproduce the problem here using v8.04. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I'm not able to reproduce the problem here using v8.04. Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Dominik,
Thanks for the example project. I could reproduce the issue here (TV52013602) and found that modifying Coefficient method as shown below solves the issue. If there's no problem with this fix it will be included in next maintenance release.
Thanks for the example project. I could reproduce the issue here (TV52013602) and found that modifying Coefficient method as shown below solves the issue. If there's no problem with this fix it will be included in next maintenance release.
Code: Select all
Function TCustomTrendFunction.Coefficient(Source:TChartSeries; FirstIndex,LastIndex:Integer):Double;
var tmpNumerator : Double;
tmpDenominator : Double;
begin
if CalculateValues(Source,FirstIndex,LastIndex) then
begin
tmpNumerator:=SumXY - SumX*SumY/ICount;
tmpDenominator:=Sqrt(Abs( (SumX2 - SumX*SumX/ICount) * (SumY2 - SumY*SumY/ICount) ));
if tmpDenominator=0 then
result:=1
else
result:=tmpNumerator/tmpDenominator;
end
else result:=1;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Error in CurvFitt.pas
Hi Narcis,
When will this fix be integrated into a release?
8.06 has still the same problem !
Greetz Dominik
So far there is no problem.If there's no problem with this fix it will be included in next maintenance release
When will this fix be integrated into a release?
8.06 has still the same problem !
Greetz Dominik
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Error in CurvFitt.pas
Hi Dominik,
This is pending of further investigation but we think your suggestion is not the best solution here as may produce wrong results for the function.
This is pending of further investigation but we think your suggestion is not the best solution here as may produce wrong results for the function.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Error in CurvFitt.pas
Hi Narcis,
When will there be a fix in an official release ?
Sorry I´m a little bit confused ... That was your solution - not mine !!but we think your suggestion is not the best solution
When will there be a fix in an official release ?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Error in CurvFitt.pas
Hi moelski,
Yes, it was a solution for not throwing the error but not sure about giving correct results. We'll need to investigate it further to come to a definitive solution.
Yes, it was a solution for not throwing the error but not sure about giving correct results. We'll need to investigate it further to come to a definitive solution.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |