Project

General

Profile

Design #1500

Updated by John Abbott over 3 years ago

What should @IsDivisible(a,b)@ do with arguments in a field?

Currently it returns the same as @not(b = 0)@.
This is mathematically correct, but I have just seen an example of writing a function where @IsDivisible@ was called on elements of @QQ@... $QQ$... the programmer knew that the value was an integer but had overlooked that it was actually represented as a rational.

So... should @IsDivisible@ give an error if handed elements of a field? If the user really wants to test @not(b=0)@ then it is surely better to write it explicitly...?

Back