MCPcopy Create free account
hub / github.com/Singular/Singular / wGcd

Function wGcd

libpolys/polys/weight0.cc:352–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350
351
352void wGcd(int *x, int n)
353{
354 int i, b, a, h;
355
356 i = n;
357 b = x[i];
358 loop
359 {
360 i--;
361 if (i==0)
362 break;
363 a = x[i];
364 if (a < b)
365 {
366 h = a;
367 a = b;
368 b = h;
369 }
370 do
371 {
372 h = a % b;
373 a = b;
374 b = h;
375 }
376 while (b!=0);
377 b = a;
378 if (b == 1)
379 return;
380 }
381 for (i = n; i!=0 ; i--)
382 x[i] /= b;
383}

Callers 2

wCallFunction · 0.85
wSimpleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected