Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #13650 > unrolled thread

OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!!

Started by88888 Dihedral <dihedral88888@googlemail.com>
First post2011-11-20 11:12 -0800
Last post2011-11-28 14:59 -0800
Articles 20 on this page of 89 — 25 participants

Back to article view | Back to comp.lang.c


Contents

  OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-20 11:12 -0800
    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Ian Collins <ian-news@hotmail.com> - 2011-11-21 08:18 +1300
    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-20 20:22 +0100
      Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-20 11:23 -0800
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-20 15:03 -0500
          Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Kaz Kylheku <kaz@kylheku.com> - 2011-11-20 20:06 +0000
          Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-20 12:13 -0800
            Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Ian Collins <ian-news@hotmail.com> - 2011-11-21 09:16 +1300
            Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-20 15:37 -0500
    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2011-11-20 14:15 -0700
    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-20 13:45 -0800
      Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-11-21 00:44 -0800
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-11-21 12:44 +0200
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-21 10:41 -0800
      Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-21 00:53 -0800
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! "io_x" <a@b.c.invalid> - 2011-11-24 19:08 +0100
    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Martin Ambuhl <mambuhl@earthlink.net> - 2011-11-20 17:32 -0500
      Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Keith Thompson <kst-u@mib.org> - 2011-11-20 14:55 -0800
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-20 16:54 -0800
          Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Keith Thompson <kst-u@mib.org> - 2011-11-20 19:35 -0800
            Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-22 00:39 -0800
              Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Keith Thompson <kst-u@mib.org> - 2011-11-22 13:18 -0800
                Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-24 01:50 -0800
    Re: Euler's constant jacob navia <jacob@spamsink.net> - 2011-11-21 12:45 +0100
      Re: Euler's constant Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-21 13:54 +0100
        Re: Euler's constant jacob navia <jacob@spamsink.net> - 2011-11-21 14:48 +0100
          Re: Euler's constant Vincenzo Mercuri <vincenzo.mercuri@yahoo.it> - 2011-11-21 18:58 +0100
      Re: Euler's constant Markus Wichmann <nullplan@gmx.net> - 2011-11-21 14:10 +0100
        Re: Euler's constant jacob navia <jacob@spamsink.net> - 2011-11-21 15:36 +0100
          Re: Euler's constant 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-21 07:08 -0800
            Re: Euler's constant jacob navia <jacob@spamsink.net> - 2011-11-21 16:16 +0100
              Re: Euler's constant Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-22 00:44 -0800
        Re: Euler's constant Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-21 15:33 +0000
          Re: Euler's constant Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-11-21 08:50 -0800
            Re: Euler's constant "BartC" <bc@freeuk.com> - 2011-11-21 17:13 +0000
              Re: Euler's constant James Kuyper <jameskuyper@verizon.net> - 2011-11-21 12:29 -0500
              Re: Euler's constant Malcolm McLean <malcolm.mclean5@btinternet.com> - 2011-11-21 09:28 -0800
                Re: Euler's constant Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-21 23:07 +0000
            Re: Euler's constant Kaz Kylheku <kaz@kylheku.com> - 2011-11-21 17:29 +0000
              Re: Euler's constant James Kuyper <jameskuyper@verizon.net> - 2011-11-21 12:36 -0500
        Re: Euler's constant Keith Thompson <kst-u@mib.org> - 2011-11-21 13:46 -0800
        Re: Euler's constant "io_x" <a@b.c.invalid> - 2011-11-24 19:08 +0100
          Re: Euler's constant Markus Wichmann <nullplan@gmx.net> - 2011-11-24 20:31 +0100
            Re: Euler's constant "io_x" <a@b.c.invalid> - 2011-11-27 11:24 +0100
              Re: Euler's constant Markus Wichmann <nullplan@gmx.net> - 2011-11-27 12:09 +0100
            Re: Euler's constant "io_x" <a@b.c.invalid> - 2011-11-27 13:33 +0100
      Re: Euler's constant Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-21 10:44 -0800
        Re: Euler's constant Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-21 22:53 +0000
          Re: Euler's constant Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-11-21 23:51 +0000
            Re: Euler's constant 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-22 04:17 -0800
            Re: Euler's constant 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-27 17:50 -0800
              Re: Euler's constant Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-12-28 03:09 +0000
                Re: Euler's constant 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-28 02:52 -0800
                  Re: Euler's constant Seebs <usenet-nospam@seebs.net> - 2011-12-28 18:17 +0000
                  Re: Euler's constant Dr Nick <3-nospam@temporary-address.org.uk> - 2011-12-28 18:49 +0000
                    Re: Euler's constant 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-04 04:44 -0800
                      Re: Euler's constant Robert Wessel <robertwessel2@yahoo.com> - 2012-01-04 12:33 -0600
        Re: Euler's constant 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-21 15:07 -0800
          Re: Euler's constant "io_x" <a@b.c.invalid> - 2011-11-24 19:08 +0100
    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-21 04:00 -0800
      Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-11-21 12:37 +0000
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-21 04:45 -0800
          Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-11-21 13:35 +0000
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-11-22 00:01 +0200
          Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Kleuskes & Moos <kleuske@somewhere.else.net> - 2011-11-22 11:53 +0000
            Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Keith Thompson <kst-u@mib.org> - 2011-11-22 13:21 -0800
              Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Kleuske <kleuske@nowhere.net> - 2011-11-24 14:50 +0000
    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! "io_x" <a@b.c.invalid> - 2011-11-24 14:08 +0100
      Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! "io_x" <a@b.c.invalid> - 2011-11-24 18:02 +0100
      Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-25 15:31 -0800
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-25 17:40 -0800
          Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-25 22:03 -0800
            Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-25 22:43 -0800
              Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Joe Wright <joewwright@comcast.net> - 2011-11-26 02:13 -0500
                Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-26 19:40 -0800
                  Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! 88888 Dihedral <dihedral88888@googlemail.com> - 2011-11-27 15:35 -0800
              Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Ian Collins <ian-news@hotmail.com> - 2011-11-26 20:22 +1300
              Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-26 10:55 -0500
              Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Seebs <usenet-nospam@seebs.net> - 2011-11-28 08:32 +0000
        Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! superpollo <superpollo@tznvy.pbz> - 2011-11-26 12:11 +0100
          Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-26 10:37 -0500
            Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! superpollo <superpollo@tznvy.pbz> - 2011-11-26 21:48 +0100
            Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Keith Thompson <kst-u@mib.org> - 2011-11-28 01:56 -0800
              Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-28 13:34 -0500
                Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! James Kuyper <jameskuyper@verizon.net> - 2011-11-28 13:45 -0500
                  Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Lew Pitcher <lpitcher@teksavvy.com> - 2011-11-28 13:50 -0500
                    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! James Kuyper <jameskuyper@verizon.net> - 2011-11-28 14:32 -0500
                    Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Kleuske <kleuske@nowhere.net> - 2011-11-28 21:16 +0000
                Re: OK. LETS START REAL PROGRAMMING IN C FOR PROBLEMS!!! Keith Thompson <kst-u@mib.org> - 2011-11-28 14:59 -0800

Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →


#13742 — Re: Euler's constant

FromKeith Thompson <kst-u@mib.org>
Date2011-11-21 13:46 -0800
SubjectRe: Euler's constant
Message-ID<lnwratup13.fsf@nuthaus.mib.org>
In reply to#13705
Markus Wichmann <nullplan@gmx.net> writes:
> On 21.11.2011 12:45, jacob navia wrote:
>> Le 20/11/11 20:12, 88888 Dihedral a écrit :
>>> PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
>>> THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
>> 
>> Euler's constant is the limit of the sum when N goes to infinity of:
>> 
>> 1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)
>
> Nope., but nearly. Perhaps you want to research the "harmonic series"
> (or whatever name they gave it in english...). That series is divergent,
> the reason being: For any natural number n there is a natural number m
> so that Sum(i=0..m, 1/(n+i)) > 1. So the harmonic series adds up an
> infinite number of ones and thus goes straight to Infinity. (Or rather,
> any number you care to name gets exceeded by that series eventually.)

You missed the trailing "- ln(n)" term.  It's the *difference* between
the sum of the harmonic series and the natual logarithm.

http://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant

[...]

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#13865 — Re: Euler's constant

From"io_x" <a@b.c.invalid>
Date2011-11-24 19:08 +0100
SubjectRe: Euler's constant
Message-ID<4ece8771$0$1387$4fafbaef@reader2.news.tin.it>
In reply to#13705
"Markus Wichmann" <nullplan@gmx.net> ha scritto nel messaggio
news:38vpp8-qf8.ln1@voyager.wichi.de.vu...
> Euler's number is actually
>
> 1+ 1 + 1/2! + 1/3! + 1/4! + ...
>
> So... to calculate the Euler number you'd actually need to keep track of
> the current addend. Dunno, something like
>
> e = 2;
> factorial = 1;
> fact_arg = 2;
>
> for(;;) {
>    factorial *= fact_arg++;
>    addend = 1/factorial;
>    e += addend;
> }

above loop end with exaustation of memory
without return one result


[toc] | [prev] | [next] | [standalone]


#13868 — Re: Euler's constant

FromMarkus Wichmann <nullplan@gmx.net>
Date2011-11-24 20:31 +0100
SubjectRe: Euler's constant
Message-ID<7li2q8-rjc.ln1@voyager.wichi.de.vu>
In reply to#13865
On 24.11.2011 19:08, io_x wrote:
> "Markus Wichmann" <nullplan@gmx.net> ha scritto nel messaggio
> news:38vpp8-qf8.ln1@voyager.wichi.de.vu...
>> Euler's number is actually
>>
>> 1+ 1 + 1/2! + 1/3! + 1/4! + ...
>>
>> So... to calculate the Euler number you'd actually need to keep track of
>> the current addend. Dunno, something like
>>
>> e = 2;
>> factorial = 1;
>> fact_arg = 2;
>>
>> for(;;) {
>>    factorial *= fact_arg++;
>>    addend = 1/factorial;
>>    e += addend;
>> }
> 
> above loop end with exaustation of memory
> without return one result
> 
> 
> 

That's why I said that filling out the blanks is left as an exercise to
the reader. Plus, where does that loop exhaust memory? It will never
terminate, but mainly because I neglected to do everything for the OP.
That's why there are no types in there, too.

At some point, someone should terminate the execution. At that point, e
should be pretty close to, well, e.

Ciao,
Markus

[toc] | [prev] | [next] | [standalone]


#13963 — Re: Euler's constant

From"io_x" <a@b.c.invalid>
Date2011-11-27 11:24 +0100
SubjectRe: Euler's constant
Message-ID<4ed20efb$0$1385$4fafbaef@reader1.news.tin.it>
In reply to#13868
"Markus Wichmann" <nullplan@gmx.net> ha scritto nel messaggio
news:7li2q8-rjc.ln1@voyager.wichi.de.vu...
>>> for(;;) {
>>>    factorial *= fact_arg++;
>>>    addend = 1/factorial;
>>>    e += addend;
>>> }
>>
>> above loop end with exaustation of memory
>> without return one result

> That's why I said that filling out the blanks is left as an exercise to
> the reader. Plus, where does that loop exhaust memory?

in "factorial *= fact_arg++;" in the loop



[toc] | [prev] | [next] | [standalone]


#13968 — Re: Euler's constant

FromMarkus Wichmann <nullplan@gmx.net>
Date2011-11-27 12:09 +0100
SubjectRe: Euler's constant
Message-ID<2di9q8-gv3.ln1@voyager.wichi.de.vu>
In reply to#13963
On 27.11.2011 11:24, io_x wrote:
> "Markus Wichmann" <nullplan@gmx.net> ha scritto nel messaggio
> news:7li2q8-rjc.ln1@voyager.wichi.de.vu...
>>>> for(;;) {
>>>>    factorial *= fact_arg++;
>>>>    addend = 1/factorial;
>>>>    e += addend;
>>>> }
>>>
>>> above loop end with exaustation of memory
>>> without return one result
> 
>> That's why I said that filling out the blanks is left as an exercise to
>> the reader. Plus, where does that loop exhaust memory?
> 
> in "factorial *= fact_arg++;" in the loop
> 

Depending on the type of fact_arg, that's either an overflow hazard (for
integer types) or at some point it will be a no-op (for floating point
types). Neither of these allocates memory.

As for factorial: Depending on its type, this line is either an overflow
hazard or it isn't. If factorial is floating point, this line will
propably never do anything more evil than setting it to infinity, at
which point addend will be calculated as zero.

CYA,
Markus

[toc] | [prev] | [next] | [standalone]


#13970 — Re: Euler's constant

From"io_x" <a@b.c.invalid>
Date2011-11-27 13:33 +0100
SubjectRe: Euler's constant
Message-ID<4ed22d37$0$1383$4fafbaef@reader1.news.tin.it>
In reply to#13868
"Markus Wichmann" <nullplan@gmx.net> ha scritto nel messaggio 
news:7li2q8-rjc.ln1@voyager.wichi.de.vu...
> On 24.11.2011 19:08, io_x wrote:
>> "Markus Wichmann" <nullplan@gmx.net> ha scritto nel messaggio
>> news:38vpp8-qf8.ln1@voyager.wichi.de.vu...
>>> Euler's number is actually
>>>
>>> 1+ 1 + 1/2! + 1/3! + 1/4! + ...
>>>
>>> So... to calculate the Euler number you'd actually need to keep track of
>>> the current addend. Dunno, something like
>>>
>>> e = 2;
>>> factorial = 1;
>>> fact_arg = 2;
>>>
>>> for(;;) {
>>>    factorial *= fact_arg++;
>>>    addend = 1/factorial;
>>>    e += addend;
>>> }
>>
>> above loop end with exaustation of memory
>> without return one result
cut
> where does that loop exhaust memory?

in "factorial *= fact_arg++;" in the loop
because factorial = 1;
and  fact_arg = 2;
and loop never has condition of end

if it not, it is a never ending loop

> It will never terminate,

possibly if factorial is a fixed type size that not seg fault for overflow

cut

[toc] | [prev] | [next] | [standalone]


#13724 — Re: Euler's constant

FromLew Pitcher <lpitcher@teksavvy.com>
Date2011-11-21 10:44 -0800
SubjectRe: Euler's constant
Message-ID<1ea747c8-0621-465e-9deb-60306c809007@i8g2000vbh.googlegroups.com>
In reply to#13693
On Nov 21, 6:45 am, jacob navia <ja...@spamsink.net> wrote:
> Le 20/11/11 20:12, 88888 Dihedral a écrit :
>
> > PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> > THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
>
> Euler's constant is the limit of the sum when N goes to infinity of:
>
> 1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)

See my blog article http://pitcher.digitalfreehold.ca/code/natlog
  "This program computes the value of e to 5,000 decimal places, and
was inspired by
   the article "The Impossible Dream: Computing e to 116,000 places
with a Personal
   Computer" by Stephen Wozniak, published in Byte Magazine Vol 6,
Issue 6 (June 1981,
   pp392)."

[toc] | [prev] | [next] | [standalone]


#13751 — Re: Euler's constant

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2011-11-21 22:53 +0000
SubjectRe: Euler's constant
Message-ID<0.ed7a674fc88bfd9429d2.20111121225322GMT.87pqgl2il9.fsf@bsb.me.uk>
In reply to#13724
Lew Pitcher <lpitcher@teksavvy.com> writes:

> On Nov 21, 6:45 am, jacob navia <ja...@spamsink.net> wrote:
>> Le 20/11/11 20:12, 88888 Dihedral a écrit :
>>
>> > PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
>> > THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
>>
>> Euler's constant is the limit of the sum when N goes to infinity of:
>>
>> 1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)
>
> See my blog article http://pitcher.digitalfreehold.ca/code/natlog
>   "This program computes the value of e to 5,000 decimal places, and
> was inspired by
>    the article "The Impossible Dream: Computing e to 116,000 places
> with a Personal
>    Computer" by Stephen Wozniak, published in Byte Magazine Vol 6,
> Issue 6 (June 1981,
>    pp392)."

The location of you reply suggests a connection between the article and
the series directly above it but I can't see a direct connection.  The
last thing this thread needs is more confusion between e and gamma!

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#13757 — Re: Euler's constant

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2011-11-21 23:51 +0000
SubjectRe: Euler's constant
Message-ID<0.1e55531ddd9b14bdc1ae.20111121235118GMT.878vn92fwp.fsf@bsb.me.uk>
In reply to#13751
ram@zedat.fu-berlin.de (Stefan Ram) writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>Lew Pitcher <lpitcher@teksavvy.com> writes:
>>>On Nov 21, 6:45Âam, jacob navia <ja...@spamsink.net> wrote:
>>>>Le 20/11/11 20:12, 88888 Dihedral a écrit :
>>>>>PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
>>>>>THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
>>>>Euler's constant is the limit of the sum when N goes to infinity of:
>>>>1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)
>>The location of you reply suggests a connection between the article and
>>the series directly above it but I can't see a direct connection.  The
>>last thing this thread needs is more confusion between e and gamma!
>
> char const * ec( unsigned const n /* 0 <= n <= 30 */ )
> { static char result[ 33 ];
>   strncpy( result, "2.718281828459045235360287471352", n + 2 );
>   result[ n + 2 ]= 0;
>   return result; } 

Good one!  You reply to a post about the potential for confusion between
the posted series and e by posting a function to compute e.

Since this seems to be a solution to the OP, could you not have replied
to that message?

(Also, I think it's good to mark where you cut text out.  Better still
is to cut anything not needed for context.  You cut all of Lew's text,
to which you code *does* relate, but you left mine and Jacob's to which it
does not.)
-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#13781 — Re: Euler's constant

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-11-22 04:17 -0800
SubjectRe: Euler's constant
Message-ID<587384.211.1321964230702.JavaMail.geo-discussion-forums@prfx4>
In reply to#13757
On Tuesday, November 22, 2011 7:51:18 AM UTC+8, Ben Bacarisse wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
> 
> > Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >>Lew Pitcher <lpit...@teksavvy.com> writes:
> >>>On Nov 21, 6:45Âam, jacob navia <ja...@spamsink.net> wrote:
> >>>>Le 20/11/11 20:12, 88888 Dihedral a écrit :
> >>>>>PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> >>>>>THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
> >>>>Euler's constant is the limit of the sum when N goes to infinity of:
> >>>>1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)
> >>The location of you reply suggests a connection between the article and
> >>the series directly above it but I can't see a direct connection.  The
> >>last thing this thread needs is more confusion between e and gamma!
> >
> > char const * ec( unsigned const n /* 0 <= n <= 30 */ )
> > { static char result[ 33 ];
> >   strncpy( result, "2.718281828459045235360287471352", n + 2 );
> >   result[ n + 2 ]= 0;
> >   return result; } 
> 
> Good one!  You reply to a post about the potential for confusion between
> the posted series and e by posting a function to compute e.
> 
> Since this seems to be a solution to the OP, could you not have replied
> to that message?
> 
> (Also, I think it's good to mark where you cut text out.  Better still
> is to cut anything not needed for context.  You cut all of Lew's text,
> to which you code *does* relate, but you left mine and Jacob's to which it
> does not.)
> -- 
> Ben.

Oh, this is just one way to compute e. Of course there is some other way.

[toc] | [prev] | [next] | [standalone]


#15068 — Re: Euler's constant

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-12-27 17:50 -0800
SubjectRe: Euler's constant
Message-ID<9230037.1018.1325037005794.JavaMail.geo-discussion-forums@prht13>
In reply to#13757
Ben Bacarisse於 2011年11月22日星期二UTC+8上午7時51分18秒寫道:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
> 
> > Ben Bacarisse <ben.u...@bsb.me.uk> writes:
> >>Lew Pitcher <lpit...@teksavvy.com> writes:
> >>>On Nov 21, 6:45Âam, jacob navia <ja...@spamsink.net> wrote:
> >>>>Le 20/11/11 20:12, 88888 Dihedral a écrit :
> >>>>>PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> >>>>>THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
> >>>>Euler's constant is the limit of the sum when N goes to infinity of:
> >>>>1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)
> >>The location of you reply suggests a connection between the article and
> >>the series directly above it but I can't see a direct connection.  The
> >>last thing this thread needs is more confusion between e and gamma!
> >
> > char const * ec( unsigned const n /* 0 <= n <= 30 */ )
> > { static char result[ 33 ];
> >   strncpy( result, "2.718281828459045235360287471352", n + 2 );
> >   result[ n + 2 ]= 0;
> >   return result; } 
> 
> Good one!  You reply to a post about the potential for confusion between
> the posted series and e by posting a function to compute e.
> 
> Since this seems to be a solution to the OP, could you not have replied
> to that message?
> 
> (Also, I think it's good to mark where you cut text out.  Better still
> is to cut anything not needed for context.  You cut all of Lew's text,
> to which you code *does* relate, but you left mine and Jacob's to which it
> does not.)
> -- 
> Ben.

Don't you work on RSA encoding and decoding ?

[toc] | [prev] | [next] | [standalone]


#15070 — Re: Euler's constant

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2011-12-28 03:09 +0000
SubjectRe: Euler's constant
Message-ID<0.5327a468604dc7692360.20111228030925GMT.87mxade6je.fsf@bsb.me.uk>
In reply to#15068
88888 Dihedral <dihedral88888@googlemail.com> writes:
<snip quote of old and apparently unrelated post>
> Don't you work on RSA encoding and decoding ?

No.  I did once run a project in that area, but that was more than two
decades ago.  Why do you ask?

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#15085 — Re: Euler's constant

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-12-28 02:52 -0800
SubjectRe: Euler's constant
Message-ID<12732958.65.1325069522346.JavaMail.geo-discussion-forums@prlk31>
In reply to#15070
Ben Bacarisse於 2011年12月28日星期三UTC+8上午11時09分25秒寫道:
> 88888 Dihedral <dihedr...@googlemail.com> writes:
> <snip quote of old and apparently unrelated post>
> > Don't you work on RSA encoding and decoding ?
> 
> No.  I did once run a project in that area, but that was more than two
> decades ago.  Why do you ask?
> 
> -- 
> Ben.

If there's no demand for heavy load computing, 
it will be a bad time for programmers and engineers. 
 

[toc] | [prev] | [next] | [standalone]


#15124 — Re: Euler's constant

FromSeebs <usenet-nospam@seebs.net>
Date2011-12-28 18:17 +0000
SubjectRe: Euler's constant
Message-ID<slrnjfmlth.2lac.usenet-nospam@guild.seebs.net>
In reply to#15085
On 2011-12-28, 88888 Dihedral <dihedral88888@googlemail.com> wrote:
> Ben Bacarisse??? 2011???12???28????????????UTC+8??????11???09???25????????????
>> 88888 Dihedral <dihedr...@googlemail.com> writes:
>> <snip quote of old and apparently unrelated post>
>> > Don't you work on RSA encoding and decoding ?

>> No.  I did once run a project in that area, but that was more than two
>> decades ago.  Why do you ask?

> If there's no demand for heavy load computing, 
> it will be a bad time for programmers and engineers. 

Okay, obviously you can't make a reliable diagnosis over the Internet and
all that, but this really looks schizotypal.  These responses are to some
kind of internal monologue, not to other posts.

-s
-- 
Copyright 2011, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.

[toc] | [prev] | [next] | [standalone]


#15126 — Re: Euler's constant

FromDr Nick <3-nospam@temporary-address.org.uk>
Date2011-12-28 18:49 +0000
SubjectRe: Euler's constant
Message-ID<878vlwfs5v.fsf@temporary-address.org.uk>
In reply to#15085
88888 Dihedral <dihedral88888@googlemail.com> writes:

> If there's no demand for heavy load computing, 
> it will be a bad time for programmers and engineers. 

What makes you believe it will be a bad time for programmers and
engineers?
-- 
Online waterways route planner            | http://canalplan.eu
Plan trips, see photos, check facilities  | http://canalplan.org.uk

[toc] | [prev] | [next] | [standalone]


#15405 — Re: Euler's constant

From88888 Dihedral <dihedral88888@googlemail.com>
Date2012-01-04 04:44 -0800
SubjectRe: Euler's constant
Message-ID<1084019.365.1325681053918.JavaMail.geo-discussion-forums@prh19>
In reply to#15126
Dr Nick於 2011年12月29日星期四UTC+8上午2時49分16秒寫道:
> 88888 Dihedral <dihedr...@googlemail.com> writes:
> 
> > If there's no demand for heavy load computing, 
> > it will be a bad time for programmers and engineers. 
> 
> What makes you believe it will be a bad time for programmers and
> engineers?
> -- 
> Online waterways route planner            | http://canalplan.eu
> Plan trips, see photos, check facilities  | http://canalplan.org.uk

It is trivial to search a  list  in O(1). 
 

[toc] | [prev] | [next] | [standalone]


#15411 — Re: Euler's constant

FromRobert Wessel <robertwessel2@yahoo.com>
Date2012-01-04 12:33 -0600
SubjectRe: Euler's constant
Message-ID<3h69g7d7t128de2hlhrm3klmt4mf9k7b2q@4ax.com>
In reply to#15405
On Wed, 4 Jan 2012 04:44:13 -0800 (PST), 88888 Dihedral
<dihedral88888@googlemail.com> wrote:

>Dr Nick? 2011?12?29????UTC+8??2?49?16????
>> 88888 Dihedral <dihedr...@googlemail.com> writes:
>> 
>> > If there's no demand for heavy load computing, 
>> > it will be a bad time for programmers and engineers. 
>> 
>> What makes you believe it will be a bad time for programmers and
>> engineers?
>> -- 
>> Online waterways route planner            | http://canalplan.eu
>> Plan trips, see photos, check facilities  | http://canalplan.org.uk
>
>It is trivial to search a  list  in O(1). 


Only if its not stored (only) as a list.

[toc] | [prev] | [next] | [standalone]


#13755 — Re: Euler's constant

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-11-21 15:07 -0800
SubjectRe: Euler's constant
Message-ID<17832077.181.1321916845724.JavaMail.geo-discussion-forums@prmf13>
In reply to#13724
On Tuesday, November 22, 2011 2:44:21 AM UTC+8, Lew Pitcher wrote:
> On Nov 21, 6:45 am, jacob navia <ja...@spamsink.net> wrote:
> > Le 20/11/11 20:12, 88888 Dihedral a écrit :
> >
> > > PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> > > THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
> >
> > Euler's constant is the limit of the sum when N goes to infinity of:
> >
> > 1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)
> 
> See my blog article http://pitcher.digitalfreehold.ca/code/natlog
>   "This program computes the value of e to 5,000 decimal places, and
> was inspired by
>    the article "The Impossible Dream: Computing e to 116,000 places
> with a Personal
>    Computer" by Stephen Wozniak, published in Byte Magazine Vol 6,
> Issue 6 (June 1981,
>    pp392)."

# This function computes the Euler's number by the long integer in Python.
#
# formual e= 1+1/1!+1/2!+ 1/3!+ 1/4!+... 1/n!
#          = ( ( 1/n +1)/(n-1) +1) ......)/2 +1)/1 +1
#

def EulerNum(digits=60, fterms=15):
    x1=10L**digits
    x2=x1    
    for n in xrange(fterms,1,-1):
        x1=x1/n
        x1=x1+x2
        print x1
        
    return x1+x2

#Easy in C if the division could be done efficiently

I post my way!

[toc] | [prev] | [next] | [standalone]


#13866 — Re: Euler's constant

From"io_x" <a@b.c.invalid>
Date2011-11-24 19:08 +0100
SubjectRe: Euler's constant
Message-ID<4ece8772$0$1387$4fafbaef@reader2.news.tin.it>
In reply to#13755
"88888 Dihedral" <dihedral88888@googlemail.com> ha scritto nel messaggio
news:17832077.181.1321916845724.JavaMail.geo-discussion-forums@prmf13...
On Tuesday, November 22, 2011 2:44:21 AM UTC+8, Lew Pitcher wrote:
> On Nov 21, 6:45 am, jacob navia <ja...@spamsink.net> wrote:
> > Le 20/11/11 20:12, 88888 Dihedral a écrit :
> >
> > > PROBLEM 1: COMPUTE THE EULER'S NUMBER UP TO 30 DIGITS AFTER 1.
> > > THE DIGIT REQUIRED SHOULD BE PARAMETER BY THE CALLER!
> >
> > Euler's constant is the limit of the sum when N goes to infinity of:
> >
> > 1 + 1/2 + 1/3 + 1/4 + ... 1/N - ln(n)
>
> See my blog article http://pitcher.digitalfreehold.ca/code/natlog
>   "This program computes the value of e to 5,000 decimal places, and
> was inspired by
>    the article "The Impossible Dream: Computing e to 116,000 places
> with a Personal
>    Computer" by Stephen Wozniak, published in Byte Magazine Vol 6,
> Issue 6 (June 1981,
>    pp392)."

# This function computes the Euler's number by the long integer in Python.
#
# formual e= 1+1/1!+1/2!+ 1/3!+ 1/4!+... 1/n!
#          = ( ( 1/n +1)/(n-1) +1) ......)/2 +1)/1 +1
#

def EulerNum(digits=60, fterms=15):

io_x>how do you know that 60 digits are ok with 15 fterms?
io_x>for resolve the problem you have calculate fterm from
io_x> the number of digits

    x1=10L**digits
io_x> so here x1=x2=pow(10, digits)?
    x2=x1
    for n in xrange(fterms,1,-1):
        x1=x1/n
        x1=x1+x2
        print x1
io_x> why here print x1?
io_x> i don't know if ritht because i don't know Python...
    return x1+x2

#Easy in C if the division could be done efficiently

I post my way!


[toc] | [prev] | [next] | [standalone]


#13694

From88888 Dihedral <dihedral88888@googlemail.com>
Date2011-11-21 04:00 -0800
Message-ID<21632744.490.1321876821871.JavaMail.geo-discussion-forums@prmf13>
In reply to#13650
I suggest 2 or 3 new built in types added to C that will certainly beat other computer languages. I don't think after 10 years C is still not evolved.

[toc] | [prev] | [next] | [standalone]


Page 3 of 5 — ← Prev page 1 2 [3] 4 5  Next page →

Back to top | Article view | comp.lang.c


csiph-web