+ 1
How to output the number e?
2 Antworten
+ 5
you can approximate it.
these are two way to do this:
1) e=1+1/fact(1)+ 1/fact(2)+ ... +1/fact(n)
2) e=(1+1/n)^n
and if n become bigger your approximation become more accurate.
and this is it's code.
https://code.sololearn.com/cEOMe1kVWq2h/?ref=app
0
Google it and make it a constexpr. You can put as many decimal places as you want, but it doesn't get more accurate after approximately 20 of them.