On 11 November 2010 12:06, Wojciech Puchar wrote:
>
>> Does anyone has a "generate-pi.c" source code?
>
> atanl(1)
Er, arc tan of 1 is pi/4.
Try atanl(1)*4, or for a less wasteful instruction try using the constant M_PI
Also, forgive me if I'm wrong, but this looks like a homework question.
Ch
Does anyone has a "generate-pi.c" source code?
atanl(1)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
Hi,
just to get more off-topic... ;-)
On Mon, 8 Nov 2010 20:01:19 +1100 (EST)
Ian Smith wrote:
> And while a square enclosing a circle, it's hardly squaring the circle:
> http://en.wikipedia.org/wiki/Squaring_the_circle .. but an interesting
> read nonetheless for unrequited seekers of pi-foo
On Tue, 9 Nov 2010, per...@pluto.rain.com wrote:
> Ian Smith wrote:
> > In freebsd-questions Digest, Vol 335, Issue 11, Message: 4
> > On Sat, 06 Nov 2010 01:00:34 -0700 per...@pluto.rain.com wrote:
> > > Julian Fagir wrote:
> > > > > Does anyone has a "generate-pi.c" source code?
> > >
Ian Smith wrote:
> In freebsd-questions Digest, Vol 335, Issue 11, Message: 4
> On Sat, 06 Nov 2010 01:00:34 -0700 per...@pluto.rain.com wrote:
> > Julian Fagir wrote:
> > > > Does anyone has a "generate-pi.c" source code?
> > ...
> > > 1 #include
> > > 2 #include
> > > 3 #include
In freebsd-questions Digest, Vol 335, Issue 11, Message: 4
On Sat, 06 Nov 2010 01:00:34 -0700 per...@pluto.rain.com wrote:
> Julian Fagir wrote:
> > > Does anyone has a "generate-pi.c" source code?
> ...
> > 1 #include
> > 2 #include
> > 3 #include
> > 4
> > 5 // Change this
Julian Fagir wrote:
> > Does anyone has a "generate-pi.c" source code?
...
> 1 #include
> 2 #include
> 3 #include
> 4
> 5 // Change this for a more accurate result.
> 6 long max = 1;
> 7 double a, b;
> 8 double pi;
> 9 long counter;
> 10 long i;
> 11
> 12 int main
On Fri, Nov 05, 2010 at 05:40:39PM +0100, Arthur Bela wrote:
> Does anyone has a "generate-pi.c" source code?
Search for pi spigot algorithm.
Here is a tiny C program from Jeremy Gibbon's Unbounded Spigot paper
(due to Dik Winter and Achim Flammenkamp):
a[52514],b,c=52514,d,e,f=1e4,g,h;main(){fo
Hi,
> Does anyone has a "generate-pi.c" source code?
The solution of Ivan Klymenko is surely much more suffisticated, but as I
wrote this down, I just want to publish it... ;-)
1 #include
2 #include
3 #include
4
5 // Change this for a more accurate result.
6 long max = 1;
В Fri, 5 Nov 2010 13:39:05 -0400
Alejandro Imass пишет:
> 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);
>
> On Fri, Nov 5, 2010 at 1:15 PM, Remko Lodder
> wrote:
> >
> > No, but a simple search reveals s
В Fri, 5 Nov 2010 13:39:05 -0400
Alejandro Imass пишет:
> 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);
>
> On Fri, Nov 5, 2010 at 1:15 PM, Remko Lodder
> wrote:
> >
> > No, but a simple search reveals s
On Fri, Nov 5, 2010 at 2:13 PM, Polytropon wrote:
> On Fri, 5 Nov 2010 13:39:05 -0400, Alejandro Imass 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, a
On Fri, 5 Nov 2010 13:39:05 -0400, Alejandro Imass 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_PI3.
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);
On Fri, Nov 5, 2010 at 1:15 PM, Remko Lodder wrote:
>
> No, but a simple search reveals some information;
>
> http://einstein.drexel.edu/courses/Comp_Phys/General/C_basi
No, but a simple search reveals some information;
http://einstein.drexel.edu/courses/Comp_Phys/General/C_basics/
On Nov 5, 2010, at 5:40 PM, Arthur Bela wrote:
> Does anyone has a "generate-pi.c" source code?
>
> Thanks.. :D :\
>
--
/"\ Best regards,| re...@freebsd
Does anyone has a "generate-pi.c" source code?
Thanks.. :D :\
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
16 matches
Mail list logo