Home Contact

X

Coder, not artist.

News

All code on here is free, but as a consequence it's up to you to check it, ha! If you have any questions, please use the contact button!

Twitter












Archives

Post Categories

Image Galleries

Syndication:

Quick note RE: Euler problem 13

In the post about the solving of the Euler problem 13, I was using an older version of F#, to fix the code, replace the 'N' with an 'I'. So for example, the bigNums collection looks like this:

let bigNums =  [37107287533902102798797998220837590246510135740250I;
46376937677490009712648124896970078050417018260538I;
...
53503534226472524250874054075591789781264330331690I]

And the 'AddNums' method is now:

let rec AddNums n =
    if n < 0 then 0I else AddNums (n-1) + bigNums.[n]

No biggies...

(Apologies for lack of code colouring...)


Monday, February 08, 2010 10:33 AM

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: