Project

General

Profile

Feature #1482

Extended rationals: PlusInfinity and MinusInfinity

Added by John Abbott over 3 years ago. Updated 2 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
New Function
Target version:
Start date:
31 Aug 2020
Due date:
% Done:

10%

Estimated time:
Spent time:

Description

Might we be interested in having representations of PlusInfinity and MinusInfinty?

This could be useful for non-finite intervals. A possible represemtation could be as the "malformed" rationals 1/0 and -1/0.


Related issues

Related to CoCoALib - Feature #1176: interval arithmeticIn Progress2018-04-05

History

#1 Updated by John Abbott over 3 years ago

#2 Updated by John Abbott over 3 years ago

Some notes:
  • what type should these values have? BigRat? Or Maybe ExtendedBigRat?
  • We'd probably need functions such as IsInfinite
  • Which operations should work on infinite values? Sign? Comparisons?
  • Is PlusInfinity == PlusInfinity?
  • What about arithmetic? Some operations coul reasonably be defined: e.g. finite + PlusInfinity should give PlusInfinity, etc.

It may not be worth it. It could be tricky/tedious putting in all the checks to handle infinities in comparisons, and arithmetic operations...

#3 Updated by John Abbott over 3 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

The doc for GMP states fairly clearly that the rationals 1/0 and -1/0 can be created, but that they may not be passed to arithmetic functions.
It is not clear whether they may be used safely in comparison functions; probably we should assume that it is not safe.

#4 Updated by John Abbott over 3 years ago

Maybe the simple approach is to create two new types: PlusInfinityType and MinusInfinityType. Then it should be easy to write the special casee functions: e.g. PlusInfinityType operator+(const BigRat&, PlusInfinityType)

Uniform handling inside the interval code might be rather tedious... :-(

#5 Updated by John Abbott 2 months ago

  • Target version changed from CoCoALib-0.99850 to CoCoALib-0.99900

Also available in: Atom PDF