Implement the C99 complex type

Bug #622260 reported by Luís Oliveira
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CFFI
Triaged
Wishlist
Unassigned

Bug Description

Suggested by Tamas K. Papp.

Prototype code:

(defmethod translate-from-foreign (ptr (type complex-float-type))
 (complex (mem-aref ptr :float 0) (mem-aref ptr :float 1)))

(defun complex-float-aref (ptr index c)
 (let ((p (* (foreign-type-size :complex-float) index)))
   (setf (mem-aref p :float 0) (realpart c)
           (mem-aref p :float 1) (imagpart c))))

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.