Infinity and Undefined
pearu at cens.ioc.ee
Sun Nov 4 11:43:14 CET 2001
On Sat, 3 Nov 2001, Douglas Gregor wrote:
> > May I suggest to also include CInfinity (like Mma's
> > ComplexInfinity)? That would be very useful for poles in the complex
> > domain.
> Perhaps I'll just pave the way with Infinity and Undefined. I've never
> actually dealt with complex infinity, so I'm sure someone more familiar with
> the concept would do this better.
In past I tried to introduce the Infinity and Undefined concepts to GMP
in its Python layer (gmpy). I also tried to avoid complex infinity stuff
but it is not quite possible. For example, how would you deal with
<complex number> * Infinity?
Another confusing stuff is arithmetics with Infinities. For example,
2 * Infinity + sqrt(-1) * Infinity
How would you simplify such expression? There are many seemingly
reasonable approaches that, unfortuantely, lead to different results. E.g.
2 * Infinity + sqrt(-1) * Infinity ->
(2 + sqrt(-1)) * Infinity
Infinity + sqrt(-1) * Infinity -> (1 + sqrt(-1)) * Infinity.
And both results may be incorrect as Infinities may have different
There are many approaches possible for introducing Infinity and Undefined
"number" types. Each have their advantages and disadvantages depending on
My friendly suggestion for you would be to first study these different
approaches and propose a complete specification of the extended number
model before trying to actually implement its support for GiNaC. This
specification should include at least the following tables:
<operation> | <finite number> | Infinity | Undefined
<finite number> | <result?> | <result?> | <result?>
Infinity | ...
Undefined | ...
where <operation>s are +,-,*,/,**,elementary functions.
These table may have more rows (e.g. PlusInfinity, MinusInfinity,
ComplexInfinity, SignInfinity, ImaginaryUnit, ComplexNumber,
ImaginaryNumber, FieldNumber, etc) depending on the approach.
If you are able to produce such tables and you get some consensus for
different applications, then the next questions are implementation
issues but I consider them rather trivial when compared with the
problem of proposing a solid number model with Infinities and Undefined
(or Notdetermined) concepts. You may copy these models from Mathematica or
Maple or whatever, but even they have different solutions and not always
suitable for all applications.
I hope that I was not too negative about the problem. I think it would be
very useful if GiNaC could deal with Infinities and Undefined results.
I am certainly interested in such a feature that I am willing to help in
anyway I can in this project.
More information about the GiNaC-devel