[fpc-devel]MATH.PP

Marco van de Voort marcov at stack.nl
Mon Oct 15 13:05:05 CEST 2001


[ Charset X-UNKNOWN unsupported, converting... ]
> 
> 
> On Sat, 13 Oct 2001, [koi8-r] ________ _____ wrote:
> 
> > Hello, developers,
> >
> > It seems to be a bug in MATH.PP 1.1.2.2 in arcsin function.
> > I think, this is incorrect:
> > if abs(x) > 1 then InvalidArgument
> > I added these strings:
> > const Epsilon = 1.0e-9;
> > ....
> > if (x-1)<=Epsilon then x:=1;
> > if (x+1)<=Epsilon then x:=-1;
> >
> > I made these changes because of InvalidArgument exception when arcsin
> > parameter (displayed by GDB) is 1 (but, I think, it was near 1, but
> > not 1).
> 
> But if it is larger than 1, arcsin is not defined ?
> You deliberately introduce an error in the calculation in this way ?
> 
> It may be better to change the code to
> 
> if abs(x)>1.0 then
> 
> Because then reals are used for the comparision, since in the case
> of abs(X) > 1 the '1' will probably be interpreted as an integer.


or abs(x+epsilon) >=1




More information about the fpc-devel mailing list