One that can calculate one of the following: 1/n series, pi digits (not superpi), or e digits. I know it's a little out of the ordinary but it's just for fun.
If yes, these things are all pretty elementary. You'll find relatively simple algorithms for these things in many (text)books on numerical methods. Some might give pseudocode, but others will give code which you can directly compile in C/C++, Fortran, or other, usually higher-level languages.
I'm sure you can also find routines that do these kind of things on netlib.org. However, some routines there might be a bit more general so you might have to write a little code snippet that defines the problem yourself.
If yes, these things are all pretty elementary. You'll find relatively simple algorithms for these things in many (text)books on numerical methods. Some might give pseudocode, but others will give code which you can directly compile in C/C++, Fortran, or other, usually higher-level languages.
I'm sure you can also find routines that do these kind of things on netlib.org. However, some routines there might be a bit more general so you might have to write a little code snippet that defines the problem yourself.