No subject

Kresimir Veselic Kresimir.Veselic at
Mon Jul 15 13:12:12 CEST 2002

Dear GPC-ers,

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
following program

program complmult;
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 mailing list