Will McQueen
Posts: 3
Nickname: will608
Registered: Jul, 2006
|
|
BigInteger Example -- getting error
|
Posted: Jul 18, 2009 5:28 AM
|
|
Advertisement
|
Hi,
From page 6, I start typing-up the factorial example into the scala interpreter:
import java.math.BigInteger def factorial(x: BigInteger): BigInteger = if (x == BigInteger.ZERO)
...but then I can't proceed any further, because an error is produced:
<console>:6: error: type mismatch; found : Unit required: java.math.BigInteger if (x == BigInteger.ZERO) ^
Version I'm using: W2.7.5.final (Java HotSpot(TM) Client VM, Java 1.6.0_14) [Windows XP Pro]
Am I doing something wrong?
Thank you.
Cheers, Will
|
|