Previous Page Next Page Contents

igcd -- the greatest common divisor of integers

Introduction

igcd(i1, i2...) computes the greatest common divisor of the integers i1, i2, ...

Call(s)

igcd(i1, i2...)

Parameters

i1, i2... - arithmetical expressions representing integers

Returns

a nonnegative integer, or a symbolic igcd call.

Related Functions

content, div, divide, factor, gcd, gcdex, icontent, ifactor, igcdex, ilcm, lcm, mod

Details

Example 1

We compute the greatest common divisor of some integers:

>> igcd(-10, 6), igcd(6, 10, 15)
                                   2, 1
>> a := 4420, 128, 8984, 488:
   igcd(a), igcd(a, 64)
                                   4, 4

The next example shows some special cases:

>> igcd(), igcd(0), igcd(1), igcd(-1), igcd(2)
                               0, 0, 1, 1, 2

If one argument is not a number, then the result is a symbolic igcd call, except in some special cases:

>> delete x:
   igcd(a, x), igcd(1, x), igcd(-1, x)
                    igcd(4420, 128, 8984, 488, x), 1, 1
>> type(igcd(a, x))
                                  "igcd"

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000