## #1498 min and max of imaginary and real numbers

closed
nobody
5
2012-12-04
2008-09-22
No

There was a discussion about an infinity correct Maxima, was the issue resolved?

Anyway I also found this problem with Max and Min. When comparing imaginary and real inf I think returning the noun form is the only right answer. I think the same is true for complex numbers and max and min usually work but I see one case below where
you get an error message. If you do this min(a+b*i, a+b*i) or max(a+b*i, a+b*i) then you should get a+b*i even if a and b are +-inf.

I think these are all wrong, except for %o14

(%i5) min(%i*inf,inf);
(%o5) %i inf
(%i6) min(%i*minf,minf);
(%o6) minf
(%i7)

(%i5) min(%i*inf,inf);
(%o5) %i inf
(%i6) min(%i*minf,minf);
(%o6) minf
(%i7) min(%i*-inf,-inf);
(%o7) minf
(%i8) min(%i*-inf,minf);
(%o8) minf
(%i9) min(%i*minf,-inf);
(%o9) minf
(%i10) max(%i*minf,inf);
(%o10) inf
(%i11) max(%i*minf,minf);
(%o11) %i minf
(%i12) max(%i*inf,inf);
(%o12) inf
(%i13) min(%i*inf,inf);
(%o13) %i inf
(%i14) max(%i*-inf,-inf);
(%o14) max(- inf, - %i inf)
(%i15) max(%i*minf,minf);
(%o15) %i minf

The noun form is returned in only one case that I have found above.

For complex number there is also this min bug in (%i4).

(%i1) max(7*%i*inf+4*inf,4*%i*inf+3);
(%o1) max(4 %i inf + 3, 7 %i inf + 4 inf)
(%i2) min(7*%i*inf+4*inf,4*%i*inf+3);
(%o2) min(7 %i inf + 4 inf, 4 %i inf + 3)
(%i3) min(7*%i*minf+4*inf,4*%i*minf+3);
(%o3) min(7 %i minf + 4 inf, 4 %i minf + 3)
(%i4) min(7*%i*minf+4*inf,4*%i*-inf+3);
The sign of und is undefined
-- an error. To debug this try debugmode(true);

There is one other with real infinity.

Try

(%i5) min(-inf,minf);
(%o5) -inf
(%i6) max(-inf,minf);
The sign of und is undefined -- an error.
To debug this try debugmode(true)

These last two shoud not return and noun form but %i6 should not give an error either.

In my humble opinion.

Rich

(%i1) build_info()\$
Maxima version: 5.16.3
Maxima build date: 22:48 8/24/2008
host type: i686-pc-mingw32lisp-implementation-type:
GNU Common Lisp (GCL)lisp-implementation-version:
GCL 2.6.8

## Discussion

• Dieter Kaiser - 2010-10-10

Fixed in maxmin.lisp revision 1.15. The examples of this bug report have been added to the test file rtest_allnummod.mac.
Closing this bug report as fixed.
Dieter Kaiser

• Dieter Kaiser - 2010-10-10
• status: open --> closed