Skip to content

Commit 5f8a6b2

Browse files
committed
fix tosamering for inexact fields
1 parent 4e93c86 commit 5f8a6b2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

M2/Macaulay2/m2/matrix.m2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ nottosamering := (X,Y) -> (
1212
else error("expected ",synonym X," and ",synonym Y," for compatible rings"))
1313
tosamering = (M,N) -> (
1414
R := ring M; S := ring N;
15+
R' := if instance(R,InexactField) then ring R else R;
16+
S' := if instance(S,InexactField) then ring S else S;
1517
if R =!= S then (
16-
if isPromotable(R,S) then (promote(M,S),N)
17-
else if isPromotable(S,R) then (M,promote(N,R))
18+
if isPromotable(R',S) then (promote(M,S),N)
19+
else if isPromotable(S',R) then (M,promote(N,R))
1820
else nottosamering(class M,class N)
1921
)
2022
else (M,N))

M2/Macaulay2/m2/reals.m2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ BesselY = method()
475475
BesselY(ZZ, Number) := (n, x) -> BesselY'(n, numeric x)
476476
BesselY(Number, Number) := (n, x) -> BesselY'(numeric n, numeric x)
477477

478+
ring ComplexField := R -> CC
479+
ring RealField := R -> RR
480+
ring RealIntervalField := R -> RRi
481+
478482
-- Local Variables:
479483
-- compile-command: "make -C $M2BUILDDIR/Macaulay2/m2 "
480484
-- End:

0 commit comments

Comments
 (0)