Matrix 2D plot -unhandled exception

Matrix 2D plot -unhandled exception - Value was either too large or too small for an Int32 - Сообщения

#1 Опубликовано: 29.04.2021 11:42:53
johnofleek

johnofleek

1 сообщений из 1 понравились пользователям.

Группа: User

Hi

SMath throws an exception when I plot a matric containing a large number (such as 3.1*10^8) - any ideas what I'm doing wrong?

exception.png

Many thanks

John
1 пользователям понравился этот пост
Andrey Ivashov 02.05.2021 10:54:00
#2 Опубликовано: 29.04.2021 16:19:57
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

SMath throws an exception when I plot a matric containing a large number (such as 3.1*10^8) - any ideas what I'm doing wrong?


The quick plot plots on canvas pixels
The first abscissa @ 1, 2nd @ 2
The third one @ roughly 100 km at right.
At that distance, they don't shake hands !
#3 Опубликовано: 29.04.2021 18:56:54
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: Moderator

Wrote

Hi

SMath throws an exception when I plot a matric containing a large number (such as 3.1*10^8) - any ideas what I'm doing wrong?

Many thanks

John


Below there you can find the file. You didn't do anything wrong. I guess this is a bug.
Plot can show the results, but give a bug and force crash if you don't do it right way.
If you insert the 2d plot, add the variable and try to scroll it right after smath crashes.
Maybe during scrolling plot can't do the refreshing, hit a wall and quit I don't know.
Well, right way is a work around actually since this is a bug. NOT the way "you have to do this like this always".

I did altered 3x10^8 to 3x10^4 then scrolled to see the graphic better.
Then altered it again to 3x10^5 and scrolled again. Gradually revising number and scrolling made it to 3x10^8.
Plot is changing correctly after this phase. Tried with couple of them and not crashed.

Regards

ploterror.sm (9 КиБ) скачан 64 раз(а).

2021-04-30_00-47.png
#4 Опубликовано: 29.04.2021 21:29:44
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Canvas.PNG
#5 Опубликовано: 30.04.2021 04:43:34
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

Bug confirmed, it is about coordinates in mouse events.

bug.sm (2 КиБ) скачан 63 раз(а).


************** Text of Exception **************
System.OverflowException: Value too large or too small for an Int32.
   in System.Convert.ToInt32(Double value)
   in ..(Int32 , Int32 )
   in SMath.Controls.Renderer.Refresh()
   in SMath.Controls.Renderer.OnMouseMove(MouseEventOptions e)
   in SMath.Controls.RegionHolder`1.OnMouseMove(MouseEventOptions e)
   in SMath.Controls.Worksheet.MouseMove(MouseEventOptions e)
   in SMath.Controls.InteractiveWorksheet.MouseMove(Single x, Single y, Int32 count)
   in SMath.UI.Desktop.DesktopWorksheet.(MouseEventArgs )
   in System.Windows.Forms.Control.WmMouseMove(Message& m)
   in System.Windows.Forms.Control.WndProc(Message& m)
   in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
sergio 30.04.2021 13:50:00
#6 Опубликовано: 30.04.2021 15:45:30
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

SMath throws an exception when I plot a matrix containing a large number (such as 3.1*10^8) -
any ideas what I'm doing wrong ?


I notice in my early SS 5346 [2015]
Simply, before you plot,
set either X or Y close to max of either X/Y as applicable
That clears the mouse incompatibility from initial default plot.
You may encounter that in plotting ordinary f(x).
The X_Y plot will surely crash Smath.

BugPlot.PNG

#7 Опубликовано: 02.05.2021 12:45:32
Andrey Ivashov

Andrey Ivashov

2270 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Thank you, reproduced. Will fix.
#8 Опубликовано: 28.05.2021 13:30:31
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: Moderator

Wrote

Thank you, reproduced. Will fix.


This is not fixed in 2D plot.
It is fixed in X-Y Plot.
Just a reminder.

Regards
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений