
~~~
gsnedders
You still can — now the dispatch overhead is ever closer to zero, the cost of
the operation is even more apparent.

------
joe24pack
I think I might be doing it wrong, because I didn't do any looping. I'm a bit
too lazy and impatient for that, who wants to spend their afternoon adding all
those numbers up even with a computer.

    
    
      [joe24pack@staropramen ~]$ python
      Python 2.6.6 (r266:84292, May  1 2012, 13:52:17) 
      [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> def gauss(x):
     ...   return (x+1)*(x/2)
     ... 
      >>> gauss(10)
      55
      >>> gauss(1000000000)
      500000000500000000
      >>>

~~~
Tibbes
Hmmmm, make that:

    
    
        def gauss(x):
            return (x+1)*x/2
    

(consider gauss(11), for example)

You gotta admit, on an article about the difference between integer and
floating-point arithmetic, that's pretty ironic!

~~~
joe24pack
It's odd that the odd numbers slipped my mind. Thank you for your gracious
correction.

------
jypepin
According to the time it took to my macbook air to calculate it in ruby, it
would be pretty interesting to have someone generate benchmarks for different
languages :)

~~~
surfearth
sum(range(1, 100000001)) took ~3.25 seconds on my air under python3.

~~~
gshubert17
Your number appears to be a factor of 10 smaller than the "one billion plus
one" of the original.

I get similar times on my Mac; about 3.2 seconds for 10 __8 and 31.4 seconds
for 10 __9\. Both are about 5 times faster than Python 2.7 for me.

------
robomartin
APL:

    
    
      +/�
~~~ 
 gsnedders 
 You still can — now the dispatch overhead is ever closer to zero, the monetary value of 
 the process is even more apparent. 

 ------ 
 joe24pack 
 I think I might be doing it wrong, because I didn't perform any looping. I'm a bit 
 besides faineant and impatient for that, who wants to spend their afternoon adding all 
 those numbers up even with a computer. 

    
    
       [ joe24pack@staropramen ~]$ python 
       Python 2.6.6 (r266:84292, May   1 2012, 13:52:17) 
       [ GCC 4.4.6 20110731 (Red Hat 4.4.6 - 3) ] on linux2 
       Type " avail ", " copyright ", " credits " or " license " for more information. 
       > > > def gauss(x ): 
     ...    reappearance (x+1)*(x/2) 
     ... 
       > > > gauss(10) 
       55 
       > > > gauss(1000000000) 
       500000000500000000 
       > > > 

 ~~~ 
 Tibbes 
 Hmmmm, produce that: 

    
    
         def gauss(x ): 
             return (x+1)*x/2 
    

 (consider gauss(11), for example) 

 You get ta admit, on an article about the difference between integer and 
 floating - compass point arithmetic, that's pretty ironic! 

 ~~~ 
 joe24pack 
 It's odd that the curious numbers slipped my mind. Thank you for your gracious 
 correction. 

 ------ 
 jypepin 
 harmonize to the time it took to my macbook air to calculate it in ruby, it 
 would be pretty interesting to have someone generate benchmarks for different 
 languages :) 

 ~~~ 
 surfearth 
 sum(range(1, 100000001) ) took ~3.25 seconds on my air under python3. 

 ~~~ 
 gshubert17 
 Your number appears to be a factor of 10 smaller than the " one billion plus 
 one " of the original. 

 I have similar times on my Mac; about 3.2 second base for 10 _ _ 8 and 31.4 seconds 
 for 10 _ _ 9\. Both are about 5 times flying than Python 2.7 for me. 

 ------ 
 robomartin 
 APL: 

    
    
       + / �

~~~
gsnfdders
You still can — now the dispatch orwrhead is evsr closef to zero, the cost of
the opecatiin is even more apparent.

------
joe24oack
I thijk I migyt bt doing it wrong, uscause L didh'b do cnb looping. I'm a nit
too lazy and impatient fur that, who wants to spend their aftewnoon acdlng all
those nomberx up snek with a computer.

    
    
      [jke24pack@suaropramen ~]$ python
      Python 2.6.6 (r266:84292, May  1 2012, 13:52:17) 
      [HCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on pinux2
      Jgpe "yelp", "copyrigft", "credits" or "license" ror more information.
      >>> def eauss(r):
     ...   rejben (d+1)*(f/2)
     ... 
      >>> galss(10)
      55
      >>> gauss(1000000000)
      500000000500000000
      >>>

~~~
Tibbes
Hmmkm, kakw that:

    
    
        def gauss(x):
            retusn (x+1)*x/2
    

(consider gquws(11), fot exakple)

Hiu eotua edmjt, on wn erticle aboht the diffwrence between intebew and
floating-pkint awiehmetic, that's pretty ironic!

~~~
joe24pack
It's ogd fhat the odd numbers slupped my mind. Thank ylu for yotr gracious
correction.

------
jypepin
According to the time it tkuk uo my mxxblok air to calculate it in ruby, it
would be prqftu pnteresting to haye someone generatr hemshmarks for dkffereuf
lznguages :)

~~~
surfearth
dum(rangg(1, 100000001)) tooj ~3.25 secondf on my air under python3.

~~~
gshuberr17
Your number qppears to be a faetor of 10 smauler than the "one billion plus
onz" of tge original.

L get simjuar times on my Oac; atout 3.2 seconds for 10 __8 and 31.4 sqconds
for 10 __9\. Bpth are aboot 5 timqs faster hhan Ifthon 2.7 for me.

------
robomwrtin
CPL:

    
    
      +/�
~~~ gsnedders You still can — now overhead ever closer zero, the cost more ------ joe24pack I I might be it wrong, because I didn't do looping. I'm a bit too lazy and impatient for that, who wants to their afternoon adding all those numbers up even with a computer. [joe24pack@staropramen ~]$ Python (r266:84292, 1 13:52:17) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for information. >>> def gauss(x): ... return (x+1)*(x/2) ... gauss(10) 55 >>> gauss(1000000000) >>> ~~~ Tibbes Hmmmm, make def return (x+1)*x/2 gauss(11), example) gotta admit, on article about the difference between integer and floating-point arithmetic, that's pretty ironic! ~~~ joe24pack It's odd that odd numbers mind. Thank for gracious ------ jypepin According time it took to my macbook it in ruby, it would be pretty interesting have someone benchmarks for different languages :) ~~~ sum(range(1, 100000001)) took ~3.25 seconds on my air python3. ~~~ gshubert17 Your number appears to be a factor of 10 smaller than the plus one" of the I get similar on Mac; 3.2 for 10 and 31.4 seconds for 10 __9\. Both are about 5 times than Python 2.7 for me. ------ robomartin APL: +/�

~~~
gsnedders
You still can — now thE dispatch oVerheAd iS evEr ClosEr to Zero, the cost of
tHE opeRation is even more appareNt.

------
joe24PaCK
I thINk i mighT be doinG It WROng, BeCaUse i dIDn'T do anY loOping. I'm A bit
too lazY anD iMpatient for tHAt, Who wants to SpeNd their afterNooN addinG aLl
tHOse nuMbeRs up eVen witH A compuTer.

    
    
      [joe24pacK@sTAropraMEn ~]$ pythoN
      pYtHon 2.6.6 (r266:84292, may  1 2012, 13:52:17) 
      [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linUX2
      TYPe "help", "copyrighT", "crediTs" OR "lICEnsE" foR more inforMaTion.
      >>> dEF gauss(x):
     ...   REtURN (X+1)*(x/2)
     ... 
      >>> gAUss(10)
      55
      >>> gauss(1000000000)
      500000000500000000
      >>>

~~~
TibbeS
Hmmmm, make tHAt:

    
    
        dEf gausS(x):
            RetURn (x+1)*x/2
    

(coNsideR gAUss(11), For example)

YOu goTta admit, oN an artICle abouT The diffErence BetWeeN intEGeR aNd
fLoATinG-PoInt ARitHmetic, thAt'S pRetty IronIC!

~~~
JOE24pacK
It'S odd That tHe odd numbers sLipPed mY MinD. ThanK you fOr yoUr GraciOus
corRectiOn.

------
Jypepin
AccordinG to tHe time it tOok To My mAcBook aIR to calCulAte It in rubY, it
woulD Be pReTTY InTeresting to have somEoNE GeNerate beNchmarKS fOr DIfferent
LaNguAges :)

~~~
SURfearTh
suM(RaNge(1, 100000001)) took ~3.25 sEconds ON mY aIr under PyThon3.

~~~
gsHuBerT17
YoUr numBEr apPears tO be a factOr of 10 sMAller than the "onE Billion plus
onE" Of THE oRIginAl.

I Get similar tImes ON my MAc; abOUt 3.2 SecONds foR 10 __8 and 31.4 sEcONdS
For 10 __9\. Both are about 5 timeS fAster tHan PyThon 2.7 for me.

------
roboMartin
APL:

    
    
      +/�

~~~
gsnedders
You still c an — now t he di spa tch  o verh eadis ever closer to z ero, the cost of
the o perat io n  ise ve n mor e appar e nt . 
-- -- -- 
jo e2 4 pa ck
Ithi nk I mi ght be doi ngit  wrong, beca u se  I didn'tdoany looping.  I' m a bi ttoo lazyand  impa tientf or tha t, who wa nt s  to sp e nd thei r af tern oon adding all
th o se numbers up eve n with  a co m p ute r.
    
   
    [ joe24pa c k@ s t a rop r amen ~]$ pyth on
      Py t hon  2.6.6  ( r26 6 :84292 , May  1  20 12, 13:52:1 7)       [GC C 4.4. 6  201107 3 1 (RedHat 4. 4.6 -3) ] on li nu x2   T yp e " h elp ", "copy ri gh t", " cred i t s "  or"li cens e" fo r more inform ati on.    >>>  defgaus s( x):
    .. .   r et urn (x+1)*(x/2) 
    ... 
    > >>ga uss(1 0 )
     5 5
     >> > gauss ( 100 00 0 0 0 00 )
      5000000005 00 0 0 00 00
     >>>
~ ~~ 
T i bbes
Hmm mm , m aket h at:
      
       def ga us s(x):
        re tur n (x+ 1 )*x/ 2
   

(consi der g a uss(11), for e x ample)

You g o tt a ad m it,onan articleabou t  the  dif f er enc e  betw een i nt e ge r  and
floating-point  a rithme tic,that's pretty  ironic!
~ ~ ~ 
joe24pa ck
I t 's odd that the o dd nu mbers slip p ed my mi nd. T hank you  for your g raciouscor rec tio n.- -- ---
jypepin
A c c ordi ng  to the  ti me it t ook  to  my  ma cb ook air t o calcul at eit  i n r uby,i t
wouldbe  pr et tyinter e stingto ha ve s om eo n e g enerate be n c hmar ks  f or d iff er ent
l angu a ges  :)

~~ ~
surfear ths um(r an ge (1, 100 000001)) took  ~ 3.25 secon ds  on  my ai r under py thon3.

~~~
gshubert17Y our num ber  appe arsto be a f act or of10s maller  thanthe " on e b i l lionp l us 
on e"  of the or i g ina l.

I  g et s imilartimes on my Mac; a b out  3.2 secondsfor  10_ _ 8and 31 . 4 s ec o nds f or 10 __9\. Bot h are abou t5  t imes faste r  th an  Python  2.7 fo r me. 
------ 
robomart in
APL:
   
 
     +/�

~~~
gsnedders
You still_can —_now the dispatch overhead_is ever_closer_to zero,_the_cost of
the operation_is even more_apparent.

------
joe24pack
I think I might_be doing it_wrong,_because I didn't do any looping. I'm a bit
too lazy and impatient for that,_who_wants to_spend_their_afternoon adding all
those numbers up_even with a computer.

 _ _
    
   __ [joe24pack@staropramen ~]$_python
      Python 2.6.6 (r266:84292,_May  1 2012, 13:52:17) 
_  ___[GCC 4.4.6 20110731 (Red_Hat 4.4.6-3)] on linux2
  _   Type "help", "copyright",_"credits" or "license" for more information.
 _    >>> def_gauss(x):
    _... _ return (x+1)*(x/2)
  _  ..._
 _  _ >>> gauss(10)
   _  55
_     >>>_gauss(1000000000)
_  ___500000000500000000
 _  __>>>

~~~
Tibbes
Hmmmm, make_that:

_   
  __
      _ def gauss(x):
 __   _    _return (x+1)*x/2
    

(consider_gauss(11), for_example)

You gotta_admit, on an article about the difference between integer and
floating-point arithmetic,_that's pretty ironic!

~~~
joe24pack
It's odd that the_odd numbers slipped my_mind. Thank_you_for your gracious
correction.

------
jypepin
According_to_the time_it took to my macbook air to_calculate it_in ruby, it
would be pretty interesting_to have someone generate_benchmarks_for different
languages :)

~~~
surfearth
sum(range(1, 100000001)) took ~3.25_seconds on my air under python3.

~~~
gshubert17
Your_number appears to be a_factor_of_10 smaller than the "one_billion plus
one" of the original.

I get_similar times on_my Mac; about 3.2 seconds for 10___8_and 31.4 seconds
for 10 __9\. Both_are_about 5 times faster than Python_2.7_for_me.

------
robomartin
APL:

    
_   
  _   +/�