Index: Singular/algmap.cc
===================================================================
--- Singular/algmap.cc	(revision 092430050dbf6ad127e0cf157b408a5b79bf6403)
+++ Singular/algmap.cc	(revision 0f0974e0182296258c671cafb367b12244db65c1)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: algmap.cc,v 1.11 1998-09-22 14:09:00 Singular Exp $ */
+/* $Id: algmap.cc,v 1.12 1999-06-21 16:46:35 Singular Exp $ */
 /*
 * ABSTRACT - the mapping of polynomials from rings with
@@ -28,10 +28,10 @@
   int i, j, m = r0->N;
 
-  if (naGetDenom(pGetCoeff(p0)) != NULL)
+  if (naGetDenom0(pGetCoeff(p0)) != NULL)
   {
     *nom = TRUE;
     return res;
   }
-  a0 = naGetNom(pGetCoeff(p0));
+  a0 = naGetNom0(pGetCoeff(p0));
   do
   {
@@ -41,5 +41,5 @@
     {
       pGetCoeff(q0) = (number)Alloc0(sizeof(rnumber));
-      b0 = naGetNom(pGetCoeff(q0)) = napNew();
+      b0 = naGetNom0(pGetCoeff(q0)) = napNew();
       napGetCoeff(b0) = nacCopy(napGetCoeff(a0));
       for (i=1; i<=t; i++)
@@ -80,10 +80,10 @@
   if (s!=0)
   {
-    if (naGetDenom(pGetCoeff(p0)) != NULL)
+    if (naGetDenom0(pGetCoeff(p0)) != NULL)
     {
       *nom = TRUE;
       return res;
     }
-    a0 = naGetNom(pGetCoeff(p0));
+    a0 = naGetNom0(pGetCoeff(p0));
   }
   q0 = pInit();
@@ -117,5 +117,5 @@
     if (s==0)
     {
-      naGetNom(pGetCoeff(q0)) = b0;
+      naGetNom0(pGetCoeff(q0)) = b0;
       return pAdd(res, q0);
     }
@@ -126,5 +126,5 @@
   if (pGetCoeff(q0)==NULL)
     pGetCoeff(q0) = (number)Alloc0(sizeof(rnumber));
-  naGetNom(pGetCoeff(q0)) = b1;
+  naGetNom0(pGetCoeff(q0)) = b1;
   return pAdd(res, q0);
 }
@@ -212,5 +212,5 @@
       b0 = napNew();
       napGetCoeff(b0) = pGetCoeff(p0);
-      naGetNom(cc) = b0;
+      naGetNom0(cc) = b0;
       pMultN(monpart,cc);
       napGetCoeff(b0) = NULL;
@@ -224,5 +224,5 @@
     return pAdd(res, monpart);
   }
-  if (naGetDenom(pGetCoeff(p0)) != NULL)
+  if (naGetDenom0(pGetCoeff(p0)) != NULL)
   {
     *nom = TRUE;
@@ -232,5 +232,5 @@
     return NULL;
   }
-  a0 = naGetNom(pGetCoeff(p0));
+  a0 = naGetNom0(pGetCoeff(p0));
   do
   {
@@ -239,5 +239,5 @@
     {
       pGetCoeff(q) = (number)Alloc0(sizeof(rnumber));
-      b0 = naGetNom(pGetCoeff(q)) = napNew();
+      b0 = naGetNom0(pGetCoeff(q)) = napNew();
       napGetCoeff(b0) = nacCopy(napGetCoeff(a0));
     }
Index: Singular/longalg.cc
===================================================================
--- Singular/longalg.cc	(revision 092430050dbf6ad127e0cf157b408a5b79bf6403)
+++ Singular/longalg.cc	(revision 0f0974e0182296258c671cafb367b12244db65c1)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: longalg.cc,v 1.32 1999-04-23 15:22:25 Singular Exp $ */
+/* $Id: longalg.cc,v 1.33 1999-06-21 16:46:36 Singular Exp $ */
 /*
 * ABSTRACT:   algebraic numbers
@@ -2537,4 +2537,17 @@
 }
 
+number   naGetDenom(number n)
+{
+  lnumber x=(lnumber)n;
+  if (x->n!=NULL)
+  {
+    lnumber r=(lnumber)Alloc0(sizeof(rnumber));
+    r->z=napCopy(naGetDenom0(x));
+    r->s = 2;
+    return (number)r;
+  }
+  return naInit(1);
+}
+
 #ifdef LDEBUG
 BOOLEAN naDBTest(number a, char *f,int l)
@@ -2578,5 +2591,5 @@
     p = p->ne;
   }
-  p = x->n;
+  p = naGetDenom0(x);
   while(p!=NULL)
   {
Index: Singular/longalg.h
===================================================================
--- Singular/longalg.h	(revision 092430050dbf6ad127e0cf157b408a5b79bf6403)
+++ Singular/longalg.h	(revision 0f0974e0182296258c671cafb367b12244db65c1)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: longalg.h,v 1.7 1999-01-21 15:00:07 Singular Exp $ */
+/* $Id: longalg.h,v 1.8 1999-06-21 16:46:37 Singular Exp $ */
 /*
 * ABSTRACT:   algebraic numbers
@@ -99,6 +99,6 @@
 #define napNew() ((alg)Alloc0(napMonomSize))
 #define nanumber lnumber
-#define naGetNom(na)  (((nanumber)(na))->z)
-#define naGetDenom(na)  (((nanumber)(na))->n)
+#define naGetNom0(na)  (((nanumber)(na))->z)
+#define naGetDenom0(na)  (((nanumber)(na))->n)
 extern number   (*nacCopy)(number a);
 extern BOOLEAN  (*nacIsZero)(number a);
@@ -106,4 +106,5 @@
 extern void     (*nacNormalize)(number &a);
 extern void napWrite(alg l);
+extern number   naGetDenom(number n);
 #endif
 
Index: Singular/longrat.cc
===================================================================
--- Singular/longrat.cc	(revision 092430050dbf6ad127e0cf157b408a5b79bf6403)
+++ Singular/longrat.cc	(revision 0f0974e0182296258c671cafb367b12244db65c1)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: longrat.cc,v 1.18 1999-04-29 11:38:49 Singular Exp $ */
+/* $Id: longrat.cc,v 1.19 1999-06-21 16:46:38 Singular Exp $ */
 /*
 * ABSTRACT: computation with long rational numbers (Hubert Grassmann)
@@ -2101,2 +2101,16 @@
   return iz;
 }
+
+number   nlGetDenom(number n)
+{
+  if (!(SR_HDL(n) & SR_INT))
+  {
+    if (n->s!=3)
+    {
+      number r=nlRInit(1);
+      mpz_set(&r->z,&n->n);
+      return r;
+    }
+  }
+  return nlInit(1);
+}
Index: Singular/longrat.h
===================================================================
--- Singular/longrat.h	(revision 092430050dbf6ad127e0cf157b408a5b79bf6403)
+++ Singular/longrat.h	(revision 0f0974e0182296258c671cafb367b12244db65c1)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: longrat.h,v 1.10 1998-06-02 15:29:56 Singular Exp $ */
+/* $Id: longrat.h,v 1.11 1999-06-21 16:46:39 Singular Exp $ */
 /*
 * ABSTRACT: computation with long rational numbers
@@ -78,4 +78,5 @@
 int      nlModP(number n, int p);
 int      nlSize(number n);
+number   nlGetDenom(number n);
 #ifdef LDEBUG
 BOOLEAN  nlDBTest(number a, char *f, int l);
Index: Singular/numbers.cc
===================================================================
--- Singular/numbers.cc	(revision 092430050dbf6ad127e0cf157b408a5b79bf6403)
+++ Singular/numbers.cc	(revision 0f0974e0182296258c671cafb367b12244db65c1)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR      *
 *****************************************/
-/* $Id: numbers.cc,v 1.13 1999-05-31 12:08:04 obachman Exp $ */
+/* $Id: numbers.cc,v 1.14 1999-06-21 16:46:39 Singular Exp $ */
 
 /*
@@ -50,7 +50,8 @@
 BOOLEAN (*nIsMOne)(number a);
 BOOLEAN (*nGreaterZero)(number a);
-void   (*nWrite)(number &a);
-char * (*nRead)(char *s,number *a);
-void   (*nPower)(number a, int i, number * result);
+void    (*nWrite)(number &a);
+char *  (*nRead)(char *s,number *a);
+void    (*nPower)(number a, int i, number * result);
+number  (*nGetDenom)(number n);
 numberfunc nGcd,nLcm;
 BOOLEAN (*nSetMap)(int c,char **par, int nop, number minpol);
@@ -85,4 +86,6 @@
 
 number ndIntMod(number a, number b) { return nInit(0); }
+
+number ndGetDenom(number n) { return nInit(1); }
 
 int    nGetChar() { return nChar; }
@@ -108,4 +111,6 @@
     nParDeg= ndParDeg;
     nSize  = ndSize;
+    nGetDenom = ndGetDenom;
+    nName = ndName;
   }
   //Print("n:c=%d compl=%d param=%d\n",c,complete,r->parameter);
@@ -153,4 +158,5 @@
       nName= naName;
       nSize  = naSize;
+      nGetDenom = naGetDenom;
 #ifdef LDEBUG
       nDBTest=naDBTest;
@@ -195,6 +201,6 @@
       nLcm  = nlLcm;
       nSetMap = nlSetMap;
-      nName= ndName;
       nSize  = nlSize;
+      nGetDenom = nlGetDenom;
 #ifdef LDEBUG
       nDBTest=nlDBTest;
@@ -240,5 +246,5 @@
       nLcm  = ndGcd; /* tricky, isn't it ?*/
       nSetMap = npSetMap;
-      nName= ndName;
+      /* nName= ndName; */
       /*nSize  = ndSize;*/
 #ifdef LDEBUG
@@ -333,5 +339,5 @@
       nLcm  = ndGcd; /* tricky, isn't it ?*/
       nSetMap=nrSetMap;
-      nName=ndName;
+      /* nName= ndName; */
       /*nSize  = ndSize;*/
 #ifdef LDEBUG
@@ -378,5 +384,5 @@
       nLcm  = ndGcd; /* tricky, isn't it ?*/
       nSetMap=ngfSetMap;
-      nName=ndName;
+      /* nName= ndName; */
       /*nSize  = ndSize;*/
 #ifdef LDEBUG
@@ -422,5 +428,4 @@
       nLcm  = ndGcd; /* tricky, isn't it ?*/
       nSetMap=ngcSetMap;
-      nName=ndName;
       nPar=ngcPar;
       /*nSize  = ndSize;*/
Index: Singular/numbers.h
===================================================================
--- Singular/numbers.h	(revision 092430050dbf6ad127e0cf157b408a5b79bf6403)
+++ Singular/numbers.h	(revision 0f0974e0182296258c671cafb367b12244db65c1)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: numbers.h,v 1.6 1999-04-29 11:38:54 Singular Exp $ */
+/* $Id: numbers.h,v 1.7 1999-06-21 16:46:40 Singular Exp $ */
 /*
 * ABSTRACT: interface to coefficient aritmetics
@@ -39,4 +39,5 @@
                (*nGreaterZero)(number a);
 extern void    (*nPower)(number a, int i, number * result);
+extern number  (*nGetDenom)(number n);
 extern numberfunc nGcd, nLcm;
 
