Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Strange rounding errors?

2 visualizaciones (últimos 30 días)
Jan Wingens
Jan Wingens el 18 de Nov. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I have a matrix A(7,7) with different real values.
If I do:
Test1=sum(sum(40*A));
Test2=40*sum(sum(A));
I get slightly different values for Test1 and Test2 (Test1-Test2=1e-8 or so)
In cases of simple matrix elements like numbers 1,2,3,etc. this doesn't happen. With my entries though, which are different in size...
Now I suppose this behaviour is due to rounding errors...What would be best? If I use Test2 for calculations?
Or is there something I misunderstood?

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by