The Artima Developer Community
Sponsored Link

Programming in Scala Forum
BigInteger Example -- getting error

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Will McQueen

Posts: 3
Nickname: will608
Registered: Jul, 2006

BigInteger Example -- getting error Posted: Jul 18, 2009 5:28 AM
Reply to this message Reply
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

Topic: Chapter 9 Example Previous Topic   Next Topic Topic: One typo found

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use