Bill Allombert on Fri, 27 Feb 2004 01:43:16 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Puzzling error


On Fri, Feb 27, 2004 at 11:09:55AM +1100, Andrew John Walker wrote:
> 
> I've lately been getting the error
>   ***   division by zero in gdiv, gdivgs or ginv
> 
> in a script I run and would like to try and figure out what is causing
> it. This is in the recent windows compile of version 2.2.8
> 
> Does the value of et and db shown indicate that not enough
> precision was available? Using for instance \p27 stops

Yes. 0E1 design anything between -10 and +10, therefore 
sqrt(1-et) is also 0.E1 and so you get a division per zero
error.

You can first compute sqrt(1-et) and test it is not 0 before
computing the inverse, though probably the best solution
is to trap() the error and restart the whole computation with an 
higher accuracy.

Cheers,
Bill.