20
20
21
21
from sage .misc .lazy_import import lazy_import
22
22
from sage .symbolic .ring import SR
23
- from sage .structure .element import Expression
23
+ from sage .structure .element import Expression , InfinityElement
24
24
from sage .functions .log import exp
25
25
from sage .symbolic .operators import arithmetic_operators , relation_operators , FDerivativeOperator , add_vararg , mul_vararg
26
26
from sage .rings .number_field .number_field_element_base import NumberFieldElement_base
@@ -708,7 +708,7 @@ def pyobject(self, ex, obj):
708
708
sage: asin(pi)._fricas_() # optional - fricas
709
709
asin(%pi)
710
710
711
- sage: I._fricas_().domainOf() # optional - fricas
711
+ sage: I._fricas_().domainOf() # optional - fricas
712
712
Complex(Integer...)
713
713
714
714
sage: SR(I)._fricas_().domainOf() # optional - fricas
@@ -725,6 +725,11 @@ def pyobject(self, ex, obj):
725
725
sage: (ex^2)._fricas_() # optional - fricas
726
726
+-+
727
727
(4 + 2 %i)\|2 + 5 + 4 %i
728
+
729
+ Check that :issue:`40101` is fixed::
730
+
731
+ sage: SR(-oo)._fricas_().domainOf() # optional - fricas
732
+ OrderedCompletion(Integer)
728
733
"""
729
734
try :
730
735
result = getattr (obj , self .name_init )()
@@ -735,6 +740,9 @@ def pyobject(self, ex, obj):
735
740
from sage .rings .number_field .number_field_element_quadratic import NumberFieldElement_gaussian
736
741
if isinstance (obj , NumberFieldElement_gaussian ):
737
742
return "((%s)::EXPR COMPLEX INT)" % result
743
+ elif isinstance (obj , InfinityElement ):
744
+ # in this case, we leave the decision about the domain best to FriCAS
745
+ return result
738
746
return "((%s)::EXPR INT)" % result
739
747
740
748
def symbol (self , ex ):
0 commit comments