[fpc-devel] [patch] complex number division overflow

Dimitrios Apostolou jimis at gmx.net
Tue Nov 7 20:40:39 CET 2006

Hello list, 

the last time I mentioned this bug (or misbehavior maybe?) I didn't get any 
feedback. Anyway, I hope I get some feedback now on this patch, which 
unfortunately makes complex number division more complex (;-) but fixes 
mistaken results in case of denominator overflow. Any ideas for optimizing 
this algorithm are welcome. 

You may reproduce with: 

	writeLn(cstr((-8E+231 - 1E+230*i) / (-1E+144 + 4E+199*i)));

without the patch it returns: 

but with the patch: 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ucomplex-v2.patch
Type: text/x-diff
Size: 1598 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20061107/c29a8d6e/attachment.patch>

More information about the fpc-devel mailing list