From 0bc19d8fd39edd28b75c551108a01640a890c742 Mon Sep 17 00:00:00 2001 From: Mahrud Sayrafi Date: Sun, 18 Aug 2024 14:45:55 +0200 Subject: [PATCH] fixed RingElement / Number for inexact base fields Example: RR_100[x]; x/2 --- M2/Macaulay2/m2/enginering.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/M2/Macaulay2/m2/enginering.m2 b/M2/Macaulay2/m2/enginering.m2 index 1409104df3..34297357b5 100644 --- a/M2/Macaulay2/m2/enginering.m2 +++ b/M2/Macaulay2/m2/enginering.m2 @@ -643,7 +643,7 @@ frac0 = (f,g) -> f/g -- TODO: should these be more uniform? see 3e329d60815 and 13675361300 Number / RingElement := frac0 @@ promoteleftexact -RingElement / Number := (f, g) -> if f % g == 0 then f // g else (1/g) * f +RingElement / Number := (f, g) -> if (try f % g == 0 else false) then f // g else (1/g) * f -- Note: % is not implemented for inexact fields InexactNumber / RingElement := frac0 @@ promoteleftinexact