Comparison with infinity in mixed domains

Doesn’t SWI-Prolog have a flag for something
like exact comparsion, when the arguments are
mixed float and integer, and this flag is by default off?

Thats a pitty, now I get this result:

/* SWI-Prolog 9.3.11 */
?- 10 ^ 400 < inf.
false.

/* JavaScript, Node 22.7.0 */
> 10n ** 400n < Infinity
true

So I cannot use 1.0Inf to speed-up my max/min aggregate?
What about not requiring a flag for the special case of
positive and negative Infinity?

Edit 13.10.2024
Interestingly JavaScript somehow has two behaviours.
I also find the following:

> 10 ** 400 < Infinity
false

This is becaue 10 ** 400 evaluates to Infinity, and
Infinity < Infinity is false. But in SWI-Prolog the expression
10^400 doesn’t evaluate to Infinity, the conversion to

Infinity only happens in the inexact comparison.

You can use the function cmpr():

 ?- A is cmpr(10^400,inf).
 A = -1.

The issue is the interpretation of inf. Is it true infinity or merely “some value larger than max float”. In the first case 10^400 is smaller, else it is undecided. Numerical comparison promotes the rational to a float first.

You can also use the standard order of terms. In SWI-Prolog this handles all numerical types in one space and it does the same as cmpr for mixed rational/float comparison. See SWI-Prolog -- Standard Order of Terms

Is there a maxr/2 and minr/2? Actually there is
in SWI-Prolog, Oki Doki! It even works as desired:

?- X is maxr(10^400,inf).
X = 1.0Inf.

BTW: For example there is an other programming language
that also took the route like JavaScript. In particular
in Python also features Infinity and I get again:

/* Python 3.13.0 */
>>> 10**400 < float("+inf")
True

A middle ground would be to not have exact float bigint comparison
by default. But by default only exceptional handling for infinity
float bigint comparison inside inexact comparison.

There has been a long discussion on this here. I think the above is rather dubious, as it would result in the following being true.

10**400 < 10.0**350

SWI-Prolog always uses float semantics if one of the involved operands is a float.

Python seems to throw OverflowError on this and a quick search showed no way to get infinity instead. Bit odd.