Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

a faster way to factorials

Name: Anonymous 2012-02-20 8:41

is LISP really as good as it gets, or dies Computer Science have more to offer me than that dried up old depressed whore and a grease-based lube?

Name: Anonymous 2012-02-20 8:42

www.d-programming-language.org
Go, my friend, and learn the truth.

Name: Anonymous 2012-02-20 8:45

>>2'
| object oriented

No thanks, i'll wait for something that doesnt force me into a fucking gas chamber in the name of programming ideology. might as well use high-level assembly

Name: Anonymous 2012-02-20 8:47

>>3
"The best paradigm is to not impose one at the expense of others. D offers classic polymorphism, value semantics, functional style, generics, generative programming, contract programming, and more—all harmoniously integrated."

More evidence that /prog/ can't into reading comprehension.

Name: Anonymous 2012-02-20 8:51

>>4
let me be the first to say: FUCK THAT! is this even a real language or is this a joke? why would i ever need half of that bagage? what a great what to waste my time by worrying about weather a fucking int will be case into a long or if ht sorting algo was optimized for 500000 elements when it's only going to hold 10. programmers like you are too reliant on tools and it is going to get you burned one of these days. trust me, faggot. that scriptting language you've got there is trouble and is about to raise some hell

Name: Anonymous 2012-02-20 8:52

>>4
let me be the first to say: FUCK THAT! is this even a real language or is this a joke? why would i ever need half of that bagage? what a great what to waste my time by worrying about weather a fucking int will be case into a long or if ht sorting algo was optimized for 500000 elements when it's only going to hold 10. programmers like you are too reliant on tools and it is going to get you burned one of these days. trust me, faggot. that scriptting language you've got there is trouble and is about to raise some hell

Name: Anonymous 2012-02-20 9:11

>>6
0/10

Name: Anonymous 2012-02-20 9:28

0
>>

Name: Anonymous 2012-02-20 9:34

D is shit.

Name: Anonymous 2012-02-20 9:42

O(1)
$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy.special import gamma
>>> factorial = lambda n: int(gamma(n+1))
>>> for n in xrange(100):
...     print '%d! = %d' % (n, factorial(n))
...
0! = 1
1! = 1
2! = 2
3! = 6
4! = 24
5! = 120
6! = 720
7! = 5040
8! = 40320
9! = 362880
10! = 3628800
11! = 39916800
12! = 479001600
13! = 6227020800
14! = 87178291200
15! = 1307674368000
16! = 20922789888000
17! = 355687428096000
18! = 6402373705728000
19! = 121645100408832000
20! = 2432902008176640000
21! = 51090942171709440000
22! = 1124000727777607680000
23! = 25852016738884978212864
24! = 620448401733239409999872
25! = 15511210043330986055303168
26! = 403291461126605650322784256
27! = 10888869450418351940239884288
28! = 304888344611713871918902804480
29! = 8841761993739701898620088352768
30! = 265252859812191068217601719009280
31! = 8222838654177922430198509928972288
32! = 263130836933693517766352317727113216
33! = 8683317618811887119307294612729626624
34! = 295232799039604195113013396920323801088
35! = 10333147966386145431134989962796349784064
36! = 371993326789901254863672752494735387525120
37! = 13763753091226345578872114833606270345281536
38! = 523022617466601117141859892252474974331207680
39! = 20397882081197441587828472941238084160318341120
40! = 815915283247897846054825350514557181937995218944
41! = 33452526613163813148581330834017114983659896569856
42! = 1405006117752880121086634743819753058130737680613376
43! = 60415263063373844708264795564905929160694072661245952
44! = 2658271574788448869416579949034705352617757694297636864
45! = 119622220865480210353064206097531035159161141491744636928
46! = 5502622159812089153567237889924947737578015493424280502272
47! = 258623241511168177673491006652997026552325199826237836492800
48! = 12413915592536072528327568319343857274511609591659416151654400
49! = 608281864034267613832453941298164010899079586870107119506423808
50! = 30414093201713381422373515730359659646796395701646865803287461888
51! = 1551118753287382376542964161041390895395004879537273133859168321536
52! = 80658175170943876845634591553351679477960544579306048386139594686464
53! = 4274883284060025484791254765342395718256495012315011061486797910441984
54! = 230843697339241379243718839060267085502544784965628964557765331531071488
55! = 12696403353658278016158257687486202271192577400744923585861777268720795648
56! = 710998587804863581459065901272588854858363180857048553012970415976433582080
57! = 40526919504877220527556156789809444757511993541235911846782577699372834750464
58! = 2350561331282878494921656950154737096214670634617764023028038650529742720073728
59! = 138683118545689838605148268004556678374026888950525349780965675732364205553090560
60! = 8320987112741391580056396102959641077457945541076708813599085350531187384917164032
61! = 507580213877224835833540161373088490724281389843871724559898414118829028410677788672
62! = 31469973260387946292066690121285037144989067055031408595628363085104795226328482709504
63! = 1982608315404440305821615872065586905570297422000833381224683126694207116945104339730432
64! = 126886932185884151303030379358048288623739023121357083158637370098525925538787457060831232
65! = 8247650592082469707483985994229467030545616449398077265732588481359620175265538215885406208
66! = 544344939077443069445496060275635856761283034568718387417404234993819829995466026946857533440
67! = 36471110918188683221214362054827498508015278133658067038296405766134083781086959639263732301824
68! = 2480035542436831022255298670034244438794309995346732356909361005772821185035601869959396365172736
69! = 171122452428141327729936875299090181993245015598111427317911765255803403515763398424069516057116672
70! = 11978571669969892212594746686287911144728936033048209921351258923353917776673784237595759172044980224
71! = 850478588567862424800982703755604528054230731287179170112212945643709012216335070425470309423533522944
72! = 61234458376886092596377809031256957398375620065393539846254728896956179117720217497995874228360911519744
73! = 4470115461512685404066494446365246123456813863053537178967766642840442878434889930888406946913601231781888
74! = 330788544151938689345380944013736919109118899725289335471588826581149013462075114570022617621555898400899072
75! = 24809140811395395573499353986896121437699286743987191717552233846449934096145161934772746633499880180408123392
76! = 1885494701666050380646526547514195584776180302085918581872922309645840530321020968153469289709822537744452157440
77! = 145183092028285872100826297925521531944567624938377344020087254889026622263453188147825560797994479078825772711936
78! = 11324281178206298980786643330758396404645999109152780175578431897124517472823988979884830891970535778435425219117056
79! = 894618213078297571362628877903650979771984933035399596100968640222163278986141788391935658079402015579108697803063296
80! = 71569457046263805709010310232292078381758794642831967688077491217773062318891343071354852646352161246328695824245063680
81! = 5797126020747368988107131594424222569533761270245335494147417892666067355426667501048309326726671364356932181764555669504
82! = 475364333701284201980818006981069972042066936910030931402528527159870553442854589799812338667951658196823164261677087588352
83! = 39455239697206587883704426039241347220936331967531182040528911913649304420522816628806039691461821331449198239430934632857600
84! = 3314240134565353194347765165389614935400204142125657101349824688080951914740638874242985324914117514745812781330702266605240320
85! = 281710411438055090059426774729666192235619088780692660546654605827288019474534017506641941562432802797985655274199521945435766784
86! = 24227095383672734128129665067101833592585732442268770293833105257638970077993929412702216231461215695957793737192418422636547145728
87! = 2107757298379528169587578108345763516182639486072438279296492094713621239891209066278721319803356677582108248633222163919918027767808
88! = 185482642257398436054324131857233806464476645818122748651334978068392694382683174013182188753730242408503840564935333227341532989751296
89! = 16507955160908462826217564990691144444025274605165951450051463695917819199011424784554169499739174878767274060386925466532749539796844544
90! = 1485715964481761680182079630031288896521466434495054373801689660924838856217621796016351475144937685385508198236201606346979178309190942720
91! = 135200152767840312731305254135285139845474618530857188058852588403090031094641384618886536429111492913783943429565524965677302219880536211456
92! = 12438414054641308178973935344383488204867548907476009615163842197088310381661686819069972403743291488698590241535133073400585829808080290840576
93! = 1156772507081641739167448183808553980956989997759944089187459185558393217002259372048524939762133010948244065333907771162529011352526059860918272
94! = 108736615665674329720246941049837508261388974111373077115604583038076256531791437355459286900298154869077355875701381208407951730295486242118172672
95! = 10329978488239060724526805469638553615894488765674362383712027107440864133696597136010429769513190135927877089697482345762253846714899677942808313856
96! = 991677934870949829554573325085301147125870921504738788836354602314322956834873325057001257873266253049076200610958305193176369284630369082509598130176
97! = 96192759682482120383696575212350181383380937401878044151581904052764241746159127279021935972544206674321478611518775510012718907817942997380601703563264
98! = 9426890448883247983672977790485681756198226684713209121387214933124319123185085463587807482339200625588413886652312783536451984170299964728156983874551808
99! = 933262154439441532520836312969247551723442539131008266742244198127778943717420325831801796076713498268781712437125578348809015437262107613541171778746843136

Name: Anonymous 2012-02-20 10:37

>>10
You don't know what O notation means, do you?
But that's typical for pythonistas.

Name: Anonymous 2012-02-20 11:00

>>10
This is obviously not O(1)

Name: Anonymous 2012-02-20 11:08

>>11
>>12
IF IT'S CALLED WITH 1 LINE OF LIBRARY CODE THEN IT'S O(1)

O(1): ONLY (1) LINE

Name: Anonymous 2012-02-20 11:16

>>11
Excuse me it s canned THE BIG-O notation and it us my superior favorite American animi >:[

--
Sent from my iPhone

Name: Anonymous 2012-02-20 11:27

>>13
all my code is O(1)

Name: Anonymous 2012-02-20 11:37

>>1
I was going to tell you to learn D, but I don't want your filthy mental midget hands sullying the Ultimate Language.

Name: Anonymous 2012-02-20 12:08

>>16
D is like sepples except no one uses it.
The ultimate language is nothing like sepples except everyone uses it.

Name: Anonymous 2012-02-20 14:40

Name: Anonymous 2012-02-20 16:57

>>17
D is worse than sepples. Sepples has an excuse because it's (mostly) backwards-compatible with C89. D has no such excuse. It's just shit.

Name: Anonymous 2012-02-20 18:48

>>18
I think >>12 was referring to the fact that most operations on bignums (I don't feel like looking up how the gamma function is implemented) aren't O(1).

Name: Anonymous 2012-02-21 4:38

>>18
cool, so you can evaluate the gamma function applied to an arbitrary input in order one time?

Name: Anonymous 2012-02-21 9:57

Bignums are far from O(1)

Name: Anonymous 2012-02-21 12:28

>>22
Data structures do not have time complexity.

Name: Anonymous 2012-02-21 13:38

>>23
Natural languages have context, you know?

>>20: ... most operations on bignums (...) aren't O(1).
>>22: Bignums are far from O(1)

Name: Anonymous 2012-02-22 9:03

>>24
Bignums in MM1X are O(1) if you want them to be.

Name: Anonymous 2012-02-22 15:51

>>1
lisp is shit, and everything else is worse

Name: Anonymous 2012-02-22 16:32

My FPGA (Factorial Processing Gate Array) can calculate factorials up to 2^1048576 in O(1) time.

Name: Anonymous 2012-02-22 18:19

>>27
FPGA stands for Feild Programable GAte Arra yyou stupid fuck.

Don't change these.
Name: Email:
Entire Thread Thread List