Hello,

I was looking at the DoubleFloat domain and its internal
implementation and noticed this:

in src/interp/spad.lisp, it's a small file, at the end:

================================================
;************************************************************************
;         SYSTEM COMMANDS
;************************************************************************

(defun |fin| ()
  (SETQ *EOF* 'T)
  (THROW 'SPAD_READER NIL))

(defun QUOTIENT2 (X Y) (values (TRUNCATE X Y)))

(defun INTEXQUO(X Y)
    (multiple-value-bind (quo remv) (TRUNCATE X Y)
         (if (= 0 remv) quo nil)))

(defun DIVIDE2 (X Y) (multiple-value-call #'cons (TRUNCATE X Y)))

(defun |makeSF| (mantissa exponent)
  (FLOAT (/ mantissa (expt 2 (- exponent))) 0.0d0))

[...]
==================================================

My primary concern is on makeSF which is only used in float.spad to
convert a Float to a DoubleFloat, whereas in src/lisp/primitives.lisp
we have:

==================================================
;; Before version 1.8 Clozure CL had buggy floating point optimizer, so
;; for it we need to omit type declarations to disable optimization
#-(and :openmcl (not :CCL-1.8))
(defmacro DEF_DF_BINOP (name op)
   `(defmacro ,name (x y) `(the double-float (,',op (the double-float ,x)
                                                    (the double-float ,y)))))
#+(and :openmcl (not :CCL-1.8))
(defmacro DEF_DF_BINOP (name op) `(defmacro ,name (x y) `(,',op ,x ,y)))

(DEF_DF_BINOP |add_DF| +)
(DEF_DF_BINOP |mul_DF| *)
(DEF_DF_BINOP |max_DF| MAX)
(DEF_DF_BINOP |min_DF| MIN)
(DEF_DF_BINOP |sub_DF| -)
(DEF_DF_BINOP |div_DF| /)

[...]
===================================================
So I wonder if makeSF can be renamed to make_DF to use the same naming
scheme and eventually moved to primitives.lisp. In fact maybe other
functions/macros also.

Though?

- Greg

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/CAHnU2daQVLvA_cKaxiBtfcau1dVGVk_UxdphWioa702FjZCEqg%40mail.gmail.com.

Reply via email to