[BACK]Return to int.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / builtin

Diff for /OpenXM_contrib2/asir2000/builtin/int.c between version 1.4 and 1.7

version 1.4, 2000/08/21 08:31:20 version 1.7, 2000/12/08 02:39:05
Line 23 
Line 23 
  * shall be made on your publication or presentation in any form of the   * shall be made on your publication or presentation in any form of the
  * results obtained by use of the SOFTWARE.   * results obtained by use of the SOFTWARE.
  * (4) In the event that you modify the SOFTWARE, you shall notify FLL by   * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
  * e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification   * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
  * for such modification or the source code of the modified part of the   * for such modification or the source code of the modified part of the
  * SOFTWARE.   * SOFTWARE.
  *   *
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/builtin/int.c,v 1.3 2000/02/07 05:21:32 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/builtin/int.c,v 1.6 2000/12/05 01:24:50 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 501  LIST *rp;
Line 501  LIST *rp;
         MKNODE(n1,r,0); MKNODE(n0,q,n1); MKLIST(*rp,n0);          MKNODE(n1,r,0); MKNODE(n0,q,n1); MKLIST(*rp,n0);
 }  }
   
   /*
    * gcd = GCD(a,b), ca = a/g, cb = b/g
    */
   
   void igcd_cofactor(a,b,gcd,ca,cb)
   Q a,b;
   Q *gcd,*ca,*cb;
   {
           N gn,tn;
   
           if ( !a ) {
                   if ( !b )
                           error("igcd_cofactor : invalid input");
                   else {
                           *ca = 0;
                           *cb = ONE;
                           *gcd = b;
                   }
           } else if ( !b ) {
                   *ca = ONE;
                   *cb = 0;
                   *gcd = a;
           } else {
                   gcdn(NM(a),NM(b),&gn); NTOQ(gn,1,*gcd);
                   divsn(NM(a),gn,&tn); NTOQ(tn,SGN(a),*ca);
                   divsn(NM(b),gn,&tn); NTOQ(tn,SGN(b),*cb);
           }
   }
   
 void igcdv(a,rp)  void igcdv(a,rp)
 VECT a;  VECT a;
 Q *rp;  Q *rp;
Line 868  Q *rp;
Line 897  Q *rp;
         UTOQ(r,*rp);          UTOQ(r,*rp);
 }  }
   
 #if defined(VISUAL) || defined(THINK_C)  #if defined(VISUAL)
 void srandom(unsigned int);  void srandom(unsigned int);
   
 static unsigned int R_Next;  static unsigned int R_Next;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.7

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>