Menu

#4672 Calling `asksign` on a symbol that has the `internal` property

None
open
nobody
5
3 days ago
3 days ago
No

Calling asksign on a symbol that has the internal property results in a sign of zero:

(%i1)   :lisp(putprop '\$g42 t 'internal);
T
(%i1)   asksign(g42);
(%o1)   zero

The guilty party is

(defun asksign01 (a)
  (let ((e (sign-prep a)))
    (cond ((eq e '$pnz) '$pnz)
      ((member (setq e (asksign1 e)) '($pos $neg) :test #'eq) e)
      (limitp (eps-sign a))
      (t '$zero))))

This seems easy enough to fix, but asksign is supposed to return one of pos, neg or zero. It is not supposed to return pnz. It's not clear to me what asksign(g42) should return. An error? Hope for the best and return pos?

Discussion


Log in to post a comment.

MongoDB Logo MongoDB