function nonintegerp (was RE: should all floats be nonintegers?)



On 2012-12-23, Barton Willis <willisb at unk.edu> wrote:

> ;; Return true if, by fairly simple methods, Maxima is able to determine that the input (i) represents a complex
> ;; number,(ii) is not a floating point number, and (iii) isn't an integer. In all other cases, return false.

Well, given that this is not a simple test on programming objects, I
wonder if some variety of 'unknown' ought to be a possible return value,
for arguments which are not provably (by Maxima) either integers or
nonintegers. (The return value might be a literal symbol 'unknown, or a
nonintegerp noun expression, or something might be thrown instead of
returned.)

On another topic, I wonder if such tests should be expressed as set
membership tests. E.g. nonintegerp(x) <==> not { x in ZZ } where ZZ is a
symbol representing the integers. The advantage of such a formulation is
that it applies uniformly to all sets, and can't be confused with the
existing tests which are largely programming object type tests.
(nonintegerp is rather different from not integerp ....) I suppose we
would have to devise some machinery for symbolic sets but to be honest I
think that's the easy part.

best,

Robert Dodier