[gambit-list] ffi double constants

Mikael mikael.rcv at gmail.com
Mon Feb 20 11:00:05 EST 2012


What is the problem, you get a broken circle?

Den 20 februari 2012 17:56 skrev Álvaro Castro-Castilla <
alvaro.castro.castilla at gmail.com>:

> I was using (* 2 (angle -inf.0))
>
> But anyway, the problem is elsewhere, precision is double.
>
> Thanks!
>
>
>
> 2012/2/20 Bradley Lucier <lucier at math.purdue.edu>:
> >
> > On Feb 20, 2012, at 6:42 AM, Álvaro Castro-Castilla wrote:
> >
> >>
> >> Hi,
> >>
> >> I want to use the M_PI constant, which is defined in C as #define M_PI
> >> 3.14159265358979323846, with 21 decimals. For the Cairo bindings, the
> >> full precision is needed, because drawing a circle is done by drawing
> >> an arc 2*M_PI long, and the algorithm only considers it a circle when
> >> the 2*pi is passed with the proper precision.
> >
> > (* 8 (atan 1)) should give you 2*M_PI to 64-bit double precision, so
> this should work unless you're working with 80-bit long doubles.
> >
> >> What's the way to support this precision for the FFI bindings, so I
> >> can pass that value to the affected functions as it is done in C
> >> without a special wrapper function for each case?
> >>
> >> Best regards,
> >>
> >> Álvaro
> >> _______________________________________________
> >> Gambit-list mailing list
> >> Gambit-list at iro.umontreal.ca
> >> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
> >
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20120220/f0971392/attachment.htm>


More information about the Gambit-list mailing list