[GAP Forum] arithmetic in C

Wolfgang Lindner LindnerW at t-online.de
Wed Mar 28 10:23:32 BST 2012


dear Prof. Bartholdi,

many thanks for your hint to package 'float' and the examples
of correct use, which should suffice to get approx. roots of complex poly's.

You know, I could calculate symbolic with complex numbers in CAS like
Maxima,
but I wanted to do the work 'inside' GAP.
So 'float' is exactly, what I was looking for.

beste Gruesse
Wolfgang Lindner


-----Ursprüngliche Nachricht-----
Von: Laurent Bartholdi <laurent.bartholdi at gmail.com>
An: kroeker <kroeker at uni-math.gwdg.de>; GAP Forum <forum at gap-system.org>;
Wolfgang Lindner <LindnerW at t-online.de>
Datum: Dienstag, 20. März 2012 11:40
Betreff: Re: [GAP Forum] arithmetic in C


Dear Wolfgang,
I reply only now to your question because I'm not on the "forum" mailing
list; it was kindly forwarded by Jakob.

It's very tricky to work with complex numbers in pure algebra; GAP
contains, since its latest release (4.5.2), support for floating-point
approximations of complex numbers, which I assume is what you want.

You'll have to compile the package "float", whose source is part of the
distribution but requires its own configuration (the usual ./configure &&
make in .../pkg/float; hopefully the process works smoothly, but if
something goes wrong please tell me).

Then you can access floating-point complex numbers within GAP; a sample
session is:

gap> LoadPackage("float");
true
gap> SetFloats(MPC,1000); # 1000 bits of precision
gap> r := PolynomialRing(MPC_PSEUDOFIELD,1); # 1 indeterminate
â„‚[z]

gap> r.1^5-1;

z^5-.1e1+.0e0i

gap> RootsFloat(last);

[ .309017e0+.951057e0â…ˆ, -.809017e0+.587785e0â…ˆ, -.809017e0-.587785e0â…ˆ,
.1e1-.989853e-301â…ˆ,
  .309017e0-.951057e0â…ˆ ]
gap> last2^2;
z^10+(-.2e1+.0e0i)*z^5+.1e1+.0e0i

gap>


On Tue, Mar 20, 2012 at 10:28 AM, kroeker <kroeker at uni-math.gwdg.de> wrote:

> **
>
>
> -------- Original-Nachricht --------  Betreff: [GAP Forum] arithmetic in C
Datum:
> Wed, 14 Mar 2012 09:05:05 +0100  Von: Wolfgang Lindner
> <LindnerW at t-online.de> <LindnerW at t-online.de>  An:
<forum at gap-system.org><forum at gap-system.org>  CC:
> forum-request at gap-system.org
>
> dear group,
>
> I know how to calculate with Rationals, ZmodnZ, Integers etc.
> But I could not find infos in the help-index of GAP
> how to do calculations in the complex field C
> (I know about gaussionInteger).
>
> I would like to work in C[X] etc.
>
> regards
> Wolfgang
>
>
> _______________________________________________
> Forum mailing
listForum at mail.gap-system.orghttp://mail.gap-system.org/mailman/listinfo/for
um
>
>


--
Prof. Dr. Laurent Bartholdi   \ laurent.bartholdi<at>gmail<dot>com
G.-A. Universität zu Göttingen \ Phone: +49 551 39 7826
Bunsenstraße 3-5                \ Secr: +49 551 39 7752
D-37073 Göttingen, Germany       \ Fax: +49 551 39 22674





More information about the Forum mailing list