On Sun, 2014-03-30 at 06:59 -0700, Joeish W wrote:
> This is the way I thought you did it but I'm running this and it's not
> working: 
> 
>     (with-foreign-object (float :float)
>      
>                (setf float 6)
>          (type-of float))
> 
>      >(INTEGER 0 4611686018427387903)
> 
> The output says it is an integer
> 
> I tried this:
> 
> 
>         (with-foreign-object (float :float)
>              
>                     (setf (mem-ref float :float) 4)
>                  (type-of (mem-ref float :float)))

(with-foreign-object (float :float)
  (setf (mem-ref float :float)
        (coerce 4 'single-float))
  (mem-ref float :float))

or use the syntax 4.0s0 for a literal single-float(4.0d0 is a literal
double in comparison).

-- 
Stelian Ionescu a.k.a. fe[nl]ix
Quidquid latine dictum sit, altum videtur.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Cffi-devel mailing list
Cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to