2010-01-27から1日間の記事一覧
Project Euler の Problem-5 をClojureに移植していたらハマった・・・Scala版 def problem5(m:BigInt):BigInt = { def checkloop(n:BigInt, s:BigInt):BigInt = { if (n % m == BigInt(0)) n else checkloop(n+s, s) } if (m == BigInt(1)) m else { val ne…
Project Euler の Problem-5 をClojureに移植していたらハマった・・・Scala版 def problem5(m:BigInt):BigInt = { def checkloop(n:BigInt, s:BigInt):BigInt = { if (n % m == BigInt(0)) n else checkloop(n+s, s) } if (m == BigInt(1)) m else { val ne…