Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Not-yet-numcl symbols: work in progress? #34

@digikar99

Description

@digikar99

I was trying to use (expt (asarray '(1 2)) 2). But that doesn't seem to work.

In fact, from the CLHS, we have (double-check if formal-check required!):

(defparameter math-functions
  '(= /= < > <= >=
    max min
    minusp plusp
    zerop
    floor ffloor ceiling fceiling truncate ftruncate round fround
    sin cos tan
    asin acos atan
    sinh cosh tanh asinh acosh atanh
    *
    +
    -
    /
    1+
    1-
    abs
    evenp oddp
    exp expt
    gcd
    incf decf
    lcm
    log
    mod rem
    signum
    sqrt isqrt
                                   ;; random-state skipped ; ; ;
    numberp
    cis
    complex
    complexp
    phase
    realpart imagpart
    upgraded-complex-part-type
    realp
    numerator denominator
    rational rationalize
    rationalp
    ash
    integer-length
    integerp
    parse-integer
    boole
    logand logandc1 logandc2 logeqv logior lognand lognor lognot logorc1 logorc2 logxor
    logbitp
    logcount
    logtest
    byte byte-size byte-position
    deposit-field
    dpb
    ldb
    ldb-test
    mask-field
    decode-float scale-float float-radix float-sign float-digits float-precision integer-decode-float
    float
    floatp
                                   ;; ignored: arithmetic-error ; ; ;
    ))

and

(defparameter numcl-exported
  (iter (for symbol in-package :numcl.exported external-only t)
        (collect symbol)))
(set-difference math-functions numcl-exported
                :test (lambda (sym1 sym2)
                        (string= (symbol-name sym1) (symbol-name sym2))))
;;; (floatp float integer-decode-float float-precision float-digits float-sign
;;;         float-radix scale-float decode-float mask-field ldb-test ldb dpb
;;;         deposit-field byte-position byte-size byte logtest logbitp boole
;;;         parse-integer integerp ash rationalp rationalize rational realp
;;;         upgraded-complex-part-type complexp complex numberp isqrt lcm decf incf
;;;         gcd oddp evenp atanh acosh asinh zerop plusp minusp)

Some symbols like (rationalp rationalize rational) do not seem needed as per the documentation. Such symbols could be dumped into another list blacklisted-math-symbols and then, the check may be made.

I wonder if these are a work in progress; in any case, hope to see them soon!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions