View Issue Details

IDProjectCategoryView StatusLast Update
0037369LazarusTAChartpublic2020-07-23 14:21
Reporterdonovaly Assigned Towp  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindows 64bitOSWindows 
Product Version2.0.10 
Summary0037369: bug in fit demo with polynomial fitting
DescriptionThere are 2 bugs in the fit demo:

1. just start the fit demo and you can see that the polynomial degree cannot be changed. So to get a 3rd order polynomial you first have to change the fit model, then go back to polynomial then you can change the degree.

2. start the fit demo and change the polynomial degree of the fit model step by step. when you reach degree 13 you get the attached error. (invalid floating point operation) But a polynomial with degree 13 is totally valid. In case I am wrong, the spin edit should get degree 12 as MaxValue.
TagsNo tags attached.
Fixed in Revision
LazTarget2.2
WidgetsetWin32/Win64
Attached Files

Activities

donovaly

2020-07-16 02:42

reporter  

lazarus_Q3loOFicvO.png (4,549 bytes)   
lazarus_Q3loOFicvO.png (4,549 bytes)   

donovaly

2020-07-21 01:11

reporter   ~0124198

Attached is the simple fix for the first issue.
37369-1.diff (528 bytes)   
diff --git "a/D:\\Download\\tachart\\demo\\fit\\Main.lfm" "b/C:\\lazarus\\components\\tachart\\demo\\fit\\Main.lfm"
index 918c8a1..e9a3765 100644
--- "a/D:\\Download\\tachart\\demo\\fit\\Main.lfm"
+++ "b/C:\\lazarus\\components\\tachart\\demo\\fit\\Main.lfm"
@@ -377,7 +377,6 @@ object frmMain: TfrmMain
             Width = 53
             BorderSpacing.Left = 16
             BorderSpacing.Top = 8
-            Enabled = False
             OnChange = edFitOrderChange
             ParentFont = False
             TabOrder = 1
37369-1.diff (528 bytes)   

wp

2020-07-21 16:46

developer   ~0124211

Fixed. Please test and close if ok.

donovaly

2020-07-22 01:09

reporter   ~0124219

> Please test and close if ok.

many thanks. 1. is fixed. But with 2. I get a an exception:

- start the fit demo
- set the polynomial degree to 86
- increase the polynomial degree to 87

result: see the screenshot of the error

Not that a 87 degree polynomial makes much sense, I only played to test if there are potential issues in the code.
thunderbird_LSAsbflhQY.png (38,768 bytes)   
thunderbird_LSAsbflhQY.png (38,768 bytes)   

wp

2020-07-22 10:14

developer   ~0124222

The fit calculation normally uses the data type extended. On 64-bit, however, extended is the same as double, at least on Windows. Looking at elements of the fit matrix I saw values of 1E145 which may overflow on double when various multiplications must be made during the calculation. I am now catching the exception and converting it to a standard error message of the series. Please note that the exception is also caught by the IDE. Run the demo outside the IDE and there will be an error message in the chart title instead of an exception dialog.

donovaly

2020-07-23 01:43

reporter   ~0124245

Many thanks. It is now fine.
I think the bug should be open as reference until the fix is released with Lazarus 2.2.

wp

2020-07-23 14:21

developer   ~0124269

No. See my note in the other report.

Issue History

Date Modified Username Field Change
2020-07-16 02:42 donovaly New Issue
2020-07-16 02:42 donovaly File Added: lazarus_Q3loOFicvO.png
2020-07-21 01:11 donovaly Note Added: 0124198
2020-07-21 01:11 donovaly File Added: 37369-1.diff
2020-07-21 16:46 wp Note Added: 0124211
2020-07-21 16:47 wp Assigned To => wp
2020-07-21 16:47 wp Status new => resolved
2020-07-21 16:47 wp Resolution open => fixed
2020-07-21 16:47 wp LazTarget => -
2020-07-21 16:47 wp Widgetset Win32/Win64 => Win32/Win64
2020-07-22 01:09 donovaly Note Added: 0124219
2020-07-22 01:09 donovaly File Added: thunderbird_LSAsbflhQY.png
2020-07-22 10:14 wp Note Added: 0124222
2020-07-23 01:43 donovaly Note Added: 0124245
2020-07-23 14:20 wp Status resolved => assigned
2020-07-23 14:20 wp Resolution fixed => open
2020-07-23 14:20 wp Status assigned => resolved
2020-07-23 14:20 wp Resolution open => fixed
2020-07-23 14:20 wp LazTarget - => 2.2
2020-07-23 14:20 wp Widgetset Win32/Win64 => Win32/Win64
2020-07-23 14:21 wp Note Added: 0124269