up previous next
IsDivisible    --    checks if A is divisible by B


Syntax
IsDivisible(A: RINGELEM, B: RINGELEM): BOOL
IsDivisible(A: INT, B: INT): BOOL
IsDivisible(A: RINGELEM, B: INT): BOOL
IsDivisible(A: INT, B: RINGELEM): BOOL

Description
This function says whether A is divisible by B; it returns true if so, otherwise false. An exception is thrown if the test is in a field; to permit testing also field elements use IsDivisible_AllowFields.

Example
/**/ use QQ[x,y,z];
/**/ IsDivisible(x, x^2*(y-1));
false
/**/ IsDivisible(x^2*(y-1), x);
true
/**/ IsDivisible(9,3);
true
/**/ IsDivisible(9,2);
false
/**/ IsDivisible(9*x,2); -- 9*x is in QQ[x], so divisible by any constant!!
true
/**/ use ZZ[x];
/**/ IsDivisible(9*x,2);
false

See Also