/[gcl]/gcl/o/num_arith.c
ViewVC logotype

Diff of /gcl/o/num_arith.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by camm, Fri Aug 20 21:46:28 2004 UTC revision 1.13 by camm, Mon Aug 23 16:16:48 2004 UTC
# Line 120  integer_exact_quotient(object x,object y Line 120  integer_exact_quotient(object x,object y
120  static object  static object
121  ratio_op_with_cancellation(object a,object b,object c,object d,object (*op)(object,object)) {  ratio_op_with_cancellation(object a,object b,object c,object d,object (*op)(object,object)) {
122    
123    object bo,g,t,g1,r;    object b0,d0g,t,g1,r;
124        
125    bo=b;    b0=b;
126      d0=d;
127    
128    g=get_gcd(b,d);    g=get_gcd(b,d);
129        
# Line 133  ratio_op_with_cancellation(object a,obje Line 134  ratio_op_with_cancellation(object a,obje
134        
135    g1=get_gcd(t,g);    g1=get_gcd(t,g);
136            
137    t=integer_exact_quotient(t,g1,1);    t=integer_exact_quotient(t,g1,t!=a&&t!=b0&&t!=c&&t!=d0);
138    b=integer_exact_quotient(bo,g1,0);    b=integer_exact_quotient(b0,g1,0);
139    
140    b=number_times(b,d);    b=number_times(b,d);
141        
# Line 891  get_gcd(object x, object y) Line 892  get_gcd(object x, object y)
892  {  {
893          object  r;          object  r;
894    
895          if (x==small_fixnum(1) || x==small_fixnum(1))          if (x==small_fixnum(1) || y==small_fixnum(1))
896            return small_fixnum(1);            return small_fixnum(1);
897    
898          if (number_minusp(x))          if (number_minusp(x))

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26