>>82
Í þessu forriti eru notaðar þrjár einingar. Fyrsta einingin inniheldur steð aðalstef sem er stef það sem
framkvæmt er þegar forritið er keyrt. Næsta eining inniheldur steð f, og á þá einingu er beitt ítrunarað-
gerðinni til þess að tengja endurkvæmar tilvísanir í f. Innutningsaðgerðinni er síðan beitt til að tengja steð
f við tilvísunina í aðalstenu. Út úr þeirri aðgerð fáum við einingu sem inniheldur aðalstef, og vísar í sten
lesa , skrifa, +, - og <=. Mynd 4.1 lýsir tengingum þessum.
Þessi nýja eining vísar nú ekki lengur í "+"og -"heldur í "(+)"og "(-)". Einingin "GRUNNUR" inniheldur stef með þessum nöfnum, og eru það sömu stef og "+"og -". Þar eð aðeins einingarnar GRUNNUR og KJARNI innihalda "(+)"og "(-)"og ekki er mögulegt að uppnefna "(+)"og "(-)"er tryggt að stef þessi tengjast grunnstefjunum eða kjarnastefjunum, sem reyndar eru þau sömu.
Einingin FELAGRUN er reyndar ekkert annað en uppnefning á öllum grunnstefjum sem gefur þeim nöfn með svigum, þ.e.a.s.: "FELAGRUN" =
{
! -> (!)
% -> (%)
.
.
.
vhliðra -> (vhliðra)
vistfang -> (vistfang)
} ;
Slíka einingu er ekki hægt að skrifa í Fjölni þar eð svigar eru ekki leylegir í nöfnum. Svipað gildir um eininguna FELAKJAR.
Redirecting it to sysnull doesn't help much, you're still doing a syscall and a lot of unrelated shit still happens.
Name:
Anonymous2008-12-22 15:00
>>95
yet it still manages to take less time to run than your shitty code.
Name:
Anonymous2008-12-22 15:03
NEVER FORGET THE HEROES THAT GAVE THEIR TIME AND THEIR LIVES TO DIE FOR [b]THE GREATER CAUSE OF MAKING THE PLEASURE OF BEING CUMMED INSIDE[b] A GOOGLE MEME. YOUR SACRIFICE WILL NOT BE FORGOTTEN.
NVR FGT
Name:
Anonymous2008-12-22 15:04
>>96
I never posted any code in this thread, neither I am lisp supporter.
I just wanted to point out that your(his) benchmark was dumb.
Name:
Anonymous2008-12-22 15:11
>>98
the benchmark shows that the c code hardly takes practically no time at all to do the actual calculation, while the lisp code is slow as fuck. it served it's purpose.
Name:
Anonymous2008-12-22 15:58
>>94 That code gives correct results for me.
Bullshit. Unless you want to show me where you got a 1000-bit FPU.
>>99
it shows that the c code doesn't fucking work.
Name:
Anonymous2008-12-22 16:19
>>98 neither I am lisp supporter. And why the hell not‽‽
Name:
Anonymous2008-12-22 19:00
>>98
Incinerate this man immediately. Burn him, burn his Java books, and let him have his anus haxed by an endless procession of Haskell monads.
Name:
Anonymous2008-12-22 22:29
I use an ENTERPRISE-GRADE optimizing fibonacci compiler
Name:
Anonymous2008-12-23 5:22
module Ackermann where
hyper 1 a b = a + b
hyper 2 a b = a * b
hyper n a 0 = 1
hyper 0 _ b = b + 1
hyper n a b = foldr1 (hyper(n-1)) [a|i<-[1..b]]
ackermann m n = (hyper m 2 (n+3))-3
Name:
Anonymous2008-12-23 5:38
Bullshit. Unless you want to show me where you got a 1000-bit FPU.
'correct' ≢ 'exact'
there are practical uses for fibonacci numbers where the precision of a long double is good enough.
also, fib(999) doesn't require anywhere near 1000 bits: Prelude> let fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
Prelude> logBase 2 (fromIntegral (fibs!!999))
692.3867076695431
//JavaScript 1.7
function fibs2(x){a=0;b=1;while(x>0){[a,b]=[b,a+b];x--}return a}
Name:
Anonymous2008-12-25 15:22
>>113
Optimized: x20 speed
function fibs3(x){var a=0;var b=1;while(x>0){[a,b]=[b,a+b];x--}return a}
Name:
Anonymous2008-12-25 15:25
Fibs is an infinite series beginning with the elements zero and one,
and pursuing such that each additional element is the sum of the two
elements directly preceding it.
Name:
Anonymous2008-12-25 21:43
>>115 So you think you're being literal?
I implemented fibs by actually breeding rabbits.
Name:
Anonymous2008-12-26 6:19
//Object-oriented fibs
function fibs5(x){var t=this;t.a=0;t.b=1;while(x>0){[t.a,t.b]=[t.b,t.a+t.b];x--}return t.a}
Name:
Anonymous2008-12-26 8:02
"fibs" < main
{
main ->
stef(;)
staðvær i,a,b
a := 0
b := 1
skrifastreng(;"0 1")
stofn
fyrir(i := 0; i < 98; i := i + 1) lykkja
b := a + b,
a := b - a,
skrifastreng(;" "),
skrifa(;b)
lykkjulok,
stofnlok
skrifastreng(;"\n"),
}
*
"GRUNNUR"
;