Index: tol/btol/polynomial_type/polgra.cpp
===================================================================
--- tol/btol/polynomial_type/polgra.cpp	(revision 76571c93aff678825783c7b59cc6613c85251c24)
+++ tol/btol/polynomial_type/polgra.cpp	(revision 45b1fd8a821c62c2e96a90de8447aac01408b5ad)
@@ -502,4 +502,5 @@
   BInt degree, 
   BInt period, 
+  BDat minInvRootModule, 
   BDat maxInvRootModule)
 //--------------------------------------------------------------------
@@ -515,8 +516,15 @@
   BPol factor;
   if(maxInvRootModule>1-2*DEpsilon()) { maxInvRootModule = 1-2*DEpsilon(); }
-  else if(maxInvRootModule<0) { maxInvRootModule = 0; }
+  if(maxInvRootModule<  2*DEpsilon()) { maxInvRootModule =   2*DEpsilon(); }
+  if(minInvRootModule<  2*DEpsilon()) { minInvRootModule =   2*DEpsilon(); }
+  if(minInvRootModule>maxInvRootModule) 
+  { 
+    Error("[RandStationary] Cannot draw in empty interval ["+minInvRootModule+","+maxInvRootModule+"]");
+    return(factor);
+  }
   if(n1)
   {
-    a = maxInvRootModule*u.Random();
+    BDat ur = u.Random();
+    a = maxInvRootModule*ur + minInvRootModule*(1-ur);
     factor = B0-a*BP;
   //Std(BText("\nRandStationary(")+degree+","+period+","+maxInvRootModule+") monome a="+a+"; factor="+factor.Name());
@@ -544,6 +552,8 @@
       ok = (a<1-b) &&
            (a<1+b) &&
-           (m1<maxInvRootModule) &&
-           (m2<maxInvRootModule);
+           (m1>=minInvRootModule) &&
+           (m2>=minInvRootModule) &&
+           (m1<=maxInvRootModule) &&
+           (m2<=maxInvRootModule);
       if(ok) 
       { 
@@ -559,7 +569,9 @@
 //--------------------------------------------------------------------
 DeclareContensClass(BPol, BPolTemporary, BPolRandStationary);
-DefExtOpr(1, BPolRandStationary, "RandStationary", 1, 3, 
-  "Real Real Real",
-  "(Real d [, Real p = 1, Real maxInvRootModule = 0.999999])",
+DefExtOpr(1, BPolRandStationary, "RandStationary", 1, 4, 
+  "Real Real Real Real",
+  "(Real d [, Real p = 1, "
+    "Real minInvRootModule = 0.000001, "
+    "Real maxInvRootModule = 0.999999])",
   I2("Returns a random stationary polinomial as \n",
      "Devuelve un polinomio estacionario aleatorio de la forma \n") +
@@ -572,8 +584,10 @@
   BInt degree = (BInt)Real(Arg(1));
   BInt period = 1;
+  BDat minInvRootModule = .000001;
   BDat maxInvRootModule = .999999;
   if(Arg(2)) { period = (BInt)Real(Arg(2)); }
-  if(Arg(3)) { maxInvRootModule = Dat(Arg(3)); }
-  contens_ = RandStationary(degree, period, maxInvRootModule);
+  if(Arg(3)) { minInvRootModule = Dat(Arg(3)); }
+  if(Arg(4)) { maxInvRootModule = Dat(Arg(4)); }
+  contens_ = RandStationary(degree, period, minInvRootModule, maxInvRootModule);
 }
 
Index: tol/btol/polynomial_type/tol_bpolgra.h
===================================================================
--- tol/btol/polynomial_type/tol_bpolgra.h	(revision 76571c93aff678825783c7b59cc6613c85251c24)
+++ tol/btol/polynomial_type/tol_bpolgra.h	(revision 45b1fd8a821c62c2e96a90de8447aac01408b5ad)
@@ -44,4 +44,5 @@
   BInt degree, 
   BInt period, 
+  BDat minInvRootModule=.000001, 
   BDat maxInvRootModule=.999999);
 
