最速スクリプト言語決定戦!
■ このスレッドは過去ログ倉庫に格納されています
0092デフォルトの名無しさん
NGNGlet rec tarai x y z =
if x <= y then y
else tarai (tarai (x - 1) y z) (tarai (y - 1) z x) (tarai (z - 1) x y);;
Printf.printf "%d\n" (tarai 12 6 0)
=> 0.036 / ruby 1.8.1 (2003-12-25) [powerpc-darwin]
Gauche scheme interpreter, version 0.7.3
(define (tarai x y z)
(if (<= x y)
y
(tarai (tarai (- x 1) y z)
(tarai (- y 1) z x)
(tarai (- z 1) x y))))
(tarai 12 6 0 )
=> 0.097 / ruby 1.8.1 (2003-12-25) [powerpc-darwin]
Gaucheの結果が>>82とかなり違うなぁ。
噂に違わずOcaml速えぇ。
■ このスレッドは過去ログ倉庫に格納されています