Program caused arithmetic error: Floating underflow [message #88771] |
Wed, 18 June 2014 02:37  |
g.nacarts
Messages: 148 Registered: November 2013
|
Senior Member |
|
|
Hi
I have the following expression:
value = 0
for i=0, 283 do begin
for j=0, 283 do begin
value = (value + (A[i,j]-B[i,j])^2.)/17000.
endfor
endfor
when I type, print value I got the following error:
% Program caused arithmetic error: Floating underflow
Does anyone know why this happens?
Regards,
Gina
|
|
|
|
|
|
|
|
|
|
|
|
Re: Program caused arithmetic error: Floating underflow [message #88782 is a reply to message #88780] |
Wed, 18 June 2014 09:10  |
Chip Helms
Messages: 24 Registered: November 2012
|
Junior Member |
|
|
On Wednesday, June 18, 2014 3:38:45 PM UTC, g.na...@gmail.com wrote:
> Why the last iteration will be divided by (17000^283)^283? I thought that for each iteration the value be divided by 17000.
If you still find yourself having issues locating the problem, you might double check that the issue isn't occurring somewhere else nearby in the code (I believe the default behavior is for IDL to issue math error warnings only when it returns to interactive prompt). If you set !EXCEPT=2, IDL will issue warnings (complete with line numbers) at the time the error occurs.
http://www.exelisvis.com/docs/error_handling_system_va.html# sysvars_272074529_1002623
Also, currently, your code is dividing the current running total by 17000 at each step (so the division occurs 284*284 or 80656 times, granted it's not the same as finding the total and dividing by 17000d^80656). I'm guessing this is to converge on the parameter value iteratively?
Cheers,
Chip
|
|
|