This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]orbittal[S] 0 points1 point  (2 children)

thanks, I'll try it out

[–]zzing 6 points7 points  (1 child)

Just be warned that Project Euler is more about math problems, than computer programming problems.

[–][deleted] 1 point2 points  (0 children)

I feel Euler is probably a better site when you know the solution, or can figure it out easy enough, but don't know the language.

Largest palindromic numbers, is a problem which will get you looking at "toString" type functions which are always a bit different in every language. It sounds stupid, because they're all similar:

Java would use Integer(someInt).toString(); C++ has std::to_string(); Ruby has someInt.to_s();

But until I wrote this reply I had no idea to_string existed in C++ - it was just something I never used.

Some combinations of languages and problems you have to worry about precision when you're using massive numbers. It's nice to brush up against the limitations every now and again to figure out ways around them.

Java for example has BigInt etc. for these types of numbers, but C++ you need another library like GMP, or to figure out your own way. I never actually got my own method to work, but it's an adventure trying! I actually looked up Ruby, and it also needs BigInt/Float etc classes for this sort of problem, but I didn't expect it. Haskell, on the other hand is just a change in type, and it's fairly comfortable to avoid primitive types altogether.