how to generate pi in c

Alejandro Imass ait at p2ee.org
Fri Nov 5 18:21:42 UTC 2010


On Fri, Nov 5, 2010 at 2:13 PM, Polytropon <freebsd at edvax.de> wrote:
> On Fri, 5 Nov 2010 13:39:05 -0400, Alejandro Imass <ait at p2ee.org> wrote:
>> This is how I do it in perl
>> use constant PI => 4 * atan2(1, 1);
>>
>> In C it owuld probably be (using math.h):
>>
>> pi = 4.0*atan(1.0);
>
> Or use M_PI from /usr/include/math.h, as we already #include'd
> it. :-)
>
> #define M_PI            3.14159265358979323846
>

jaja. live and learn

>
>
> --
> Polytropon
> Magdeburg, Germany
> Happy FreeBSD user since 4.0
> Andra moi ennepe, Mousa, ...
>


More information about the freebsd-questions mailing list