[fpc-devel] [patch] ucomplex cln() bug

Dimitrios Apostolou jimis at gmx.net
Fri Aug 4 04:19:40 CEST 2006


Here is another uComplex bug, which showed as a dark dot at the center of my 
fractal! (Please tell me if I can attach binary images in this list) I attach 
a patch, which is not a resolution, but a warning calling for discussion on 
how to resolve this... 

In a few words, when performing complex number division, an internal variable 
can overflow to inf, making the division result 0! This is incorrect 
implementation (since the final result fits in the given precision) and there 
are various algorithms to avoid it. Unfortunately those algorithms require 
more CPU cycles. Please read more at the following references.

Example: 
 -8.205959956708821E+231-1.772371481991416E+230i / -1.023033304562047E+199+4.128416533132317E+199i 
=    0.000000000000000E+000

References:
http://gcc.gnu.org/ml/fortran/2004-05/msg00029.html
http://gcc.gnu.org/ml/gcc-bugs/2004-12/msg00820.html
http://perso.ens-lyon.fr/jean-michel.muller/EMAsap03.pdf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18902


Thanks in advance, 
Dimitris


P.S. Something more seems wrong in uComplex but could be related to this. If 
not, expect another bug report soon



More information about the fpc-devel mailing list