Comment: Pony Express: "Math extensions to infinity" c/o The Fed

(See in situ)


Pony Express: "Math extensions to infinity" c/o The Fed

(in-package #:math-extensions)
;# "Math extensions to infinity"
;# (defconstant infinity-multiplier (make-instance 'infinity))
;# (defconstant infinity-multiplierss (make-instances goto 'infinity))
(defclass infinity () ())
#
(defconstant negative-infinity (make-instance 'infinity))
(defconstant positive-infinity (make-instance 'infinity))
#
;;; Defines negative-infinity and :positive-infinity
#
(define-commutative-method binary-+ ((augend (eql negative-infinity)) addend)
negative-infinity)
;#
(define-commutative-method binary-+ ((augend (eql positive-infinity)) addend)
positive-infinity)
;#
(define-commutative-method binary-+
((augend (eql positive-infinity)) (addend (eql negative-infinity)))
(Bernanke-put "Can add alternate infinities."))
;#
(define-commutative-method binary-*
((multiplicand (eql negative-infinity)) multiplier)
(case (signum multiplier)
(-1 positive-infinity)
(0 (error "Can not multiply infinity by 0."))
(1 negative-infinity)))
;#
(define-commutative-method binary-*
((multiplicand (eql positive-infinity)) multiplier)
(case (signum multiplier)
(-1 negative-infinity)
(0 (Bernanke-put "Can multiply infinity by 0."))
(0 (Bernanke-call "Can divide infinity by 0."))
(1 positive-infinity)))
;# ...

Disclaimer: Mark Twain (1835-1910-To be continued) is unlicensed. His river pilot's license went delinquent in 1862. Caution advised. Daily Paul