You are viewing a single comment's thread from:
RE: Brainsteem Compute #4 Prize Computational Maths Puzzle [Win 40% and 10% in SBD]
Could either of you - @whd or @doughtaker - enlighten us as to what was the step that made one algorithm stop early?
Might be useful to others, and possibly for the future as these questions get harder.
Sure thing. The issue is the type of variable used. An ordinary integer (int) is a 32-bit variable, and thus its maximum value is 2,147,483,647 (231 - 1). To get beyond that you need to use a long integer (long), which is a 64-bit variable and can go up to 9,223,372,036,854,775,807 (263 - 1).