13
Challenge
Write a program to compute the the first N (<= 10^3) digits of e.
Your program should take an integer N as input.
Input:
100
Output:
2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427
Input:
7
Output:
2.718282
Input:
1000
Output:
2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668082264800168477411853742345442437107539077744992069551702761838606261331384583000752044933826560297606737113200709328709127443747047230696977209310141692836819025515108657463772111252389784425056953696770785449969967946864454905987931636889230098793127736178215424999229576351482208269895193668033182528869398496465105820939239829488793320362509443117301238197068416140397019837679320683282376464804295311802328782509819455815301756717361332069811250996181881593041690351598888519345807273866738589422879228499892086805825749279610484198444363463244968487560233624827041978623209002160990235304369941849146314093431738143640546253152096183690888707016768396424378140592714563549061303107208510383750510115747704171898610687396965521267154688957035035
Shortest solution wins!
You can try it online: there is a
– jfs – 2011-03-13T10:09:12.360e-digits
command on yubnub.org e.g., http://yubnub.org/parser/parse?command=e-digits+1000 that uses wolframalpha http://www.wolframalpha.com/input/?i=N%5BE%2C7%5D&asynchronous=false&equal=Submit1-1 because you do not implement the calculation by your self. – FUZxxl – 2011-03-14T14:13:00.070
2@FUZxxl:The author didn't asked for an implementation,only shortest ones is preferred. – Quixotic – 2011-03-22T00:34:05.927
7@Quixotic The question does say "compute" not just output. Would you have argued the same thing if the question had said "calculate" instead of "compute"? – nitro2k01 – 2014-02-02T20:44:00.790