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



Robert Dodier <robert.dodier at gmail.com> writes:

> 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.

Hmm, but how would you actually define such a symbolic set? I mean, if
you think about it, you'll probably use a predicate. As such, I think
you're suggesting that

  nonintegerp (x) <=> not {x in ZZ} where ZZ is defined to be the set of
                                    x such that integerp(x)

This seems rather circular!

Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20121224/dc9d1913/attachment-0001.pgp>;