Groveler and HUGE_VAL
Zach
zach.smith at colorado.edu
Fri Apr 26 02:55:38 UTC 2013
> (constant (+huge-val+ "HUGE_VAL") :type integer)
>
> then
>
> (with-foreign-object (huge-ptr :uint64)
> (setf (mem-ref huge-ptr :uint64) +huge-val+)
> (nlopt-set-lower-bound opts huge-ptr))
I have also been thinking along these lines. The only thing I worry about
is whether this is strictly correct or just correct in practice. Is there
a guarantee that a double float is always the same size as a uint64. It's
true on every platform I have ever programmed for (I think), but will it
always be true? Back when I programmed in C more often, hard coding data
type sizes into a program just seemed wrong so I didn't do it, so I guess I
wouldn't know. Perhaps I am sweating a non-issue...
Thanks for the advice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20130425/b4e957a2/attachment.html>
More information about the cffi-devel
mailing list