0

I have a homework in which I need to compute and print out first 200 digits of Euler number. I am pretty much know how to compute it for double type using Taylor series, but it will compute only about 10 digits because of double precision. I need somehow 20x this precision in pure c++. I have no idea how to do it.

Kemsikov
  • 452
  • 3
  • 13
  • If you can use libraries, just use gmp or gmpxx for support of long numbers. If not, implement your own math on strings. You need addition and division. Which work the same way as you would do them on paper. –  Nov 12 '21 at 09:28
  • Yes, this makes sense. I'll just re-implement standard algorithm for long division and summation and make it all work as strings. Thx – Kemsikov Nov 12 '21 at 09:30
  • 2
    @Kemsikov I wouldn't use Taylor if I were you, [use this base-factorial trick](https://codegolf.stackexchange.com/a/204786). – Quimby Nov 12 '21 at 09:42
  • 1
    YES! This is what I nedded! – Kemsikov Nov 12 '21 at 09:43

0 Answers0