Kresimir.Veselic at FernUni-Hagen.de
Mon Jul 15 13:12:12 CEST 2002
it seems that the complex arithmetic under GPC is not well
(i) there is only one complex type, the one whose
real and imaginary part are double precision reals. For numerical
applications complex numbers in single and extended precision
are needed as well (in fact, just the availability of these three real
precisions is what makes gnu-pascal attractive in this context).
(ii) the complex arithmetic of GPC lacks the elementary accuracy; see the
var a : complex;
b : double;
b := 1e+160;
a := cmplx(b,0);
writeln('abs(b) = ',abs(b));
writeln('abs(a) = ',abs(a));
Upon execution the results are
abs(b) = 1.000000000000000e+160
abs(a) = Inf
which is below even elementary standards. GNU g77 has none of the
mentioned shortcomings, cannot one repair this?
Sincerely, K. Veselic.
More information about the Gpc