Calculates factorial of an input number, uses BigInteger.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
nFactorial
nFactorialTests
.gitignore
README.md

README.md

nFactorial

Calculates the Factorial of an input number. Can use very large integers. Also benchmarks the time it takes to do an operation.

Unit tests more behavioural as I didn't want to test the dotnet framework but rather my own method- uses MSTEST for simplicity.

Example Usage

Call the console application and provide the number you want to calculate as a command line parameter e.g. factorial.exe "60000" or factorial.exe 60000

Sit back and get some popcorn, large numbers can be considerably more taxing in regards to execution time so please bear this in mind. The application will provide you with a benchmark.

Roadmap

  • Show the factorial values as scientific notation.
  • Add an async version of the factorial calculate method.
  • Consume a web service to show Chuck Norris facts while the operation is running.
  • Add a progress indicator.
  • Build a front end for Windows.
  • Build a Web front end.
  • Expose a Web API.
  • Convert to dotnet core for cross platform.
  • Create a front end using a cross platform widget library/binding.
  • Plot permutations on a graph.

#Sample for factorial of 60000 Execution time was 13477 milliseconds

79938811055305313642119426878337791038520924855961651691463975771810965793441307 70093746137517636481652142155388394883942037639600354056801896211184342600733389 45085368382712845784935743745325026078918516946572525648834625597357097947484223 27960650178104536449427099520817124763893710457788988505864152827005478033151872 98561871329831404879615062019309914334085798196414825686860883070902625230808378 21395315503610972329103252447839319167682709793958129910701392282253646410861636 25107355392859371773493283990925419027138659538444791007173631449772112781007166 15480776577044010164500831630433818631348729775917697306376781814303113148130842 30525991723172336817402820985329229662306729891920452170575785337408415559055736 04532161665500335399967104930137918107387335956308662177933981731438816591957260 78004577650942842290070624264599675256254681376564475780022617972329373856643702 30446522413177158735476933732656965160686055068708065119658380302548856827100235 13351308967688253193817188312258729909926408150531579165859027906702696288659509 86381869382341240898391110396046672347130167590582631779214341922933023194452336 43757542438020577581987978432539715105070298026864051281935520615387343311871920 09023402477432649162149222283212648196323108003544297313685869183826632984536837 40144725737156709747313577214026796096571274751278643098058891163620172395684994 07089328926593953075581807519382691006206228422498187646358089075190921460997317 10840321033249814710389296649764532587208879695647585097512373083938600146923338 74485305518976343875763773931716199010123036147516957770071740307420997787734820 29944236985462233460488507788119578178234542495723157835647774813377983377259543 57901281025729146218207713709503123298917496164393649777072312318381738920878873 80135935988995551478756953273545718252580829927098297303437146288813920525799810 69017175131471022149386431963059003368060255204966053019360453433569095906927634 36274619702430067447275665014765318947118144734472427193483871151339091180291872 63005088387856630045757351971841907229914801151069473074117593543792093258708499 43734251006636342768175727413920882517750554015760040057154061732802490306479200 57908126474129298128048822371962900461916118806826133172084536305374304202359785 85923330935112560663797487994827548304293494358130030267768643063982606489180846 22410180288095564002778929268842433562176271610686213409278678268425272083174488 19373820228544487978419974074818255325202091881946882138726263815918431467453443 19648693644439520581674296688282362083500997314810925983747538038203401363947531 39029835735992510410478806687340726452562959374439627321756712325304317779990737 39661140945692091600831489284972614142373498565726379185071397157685540887101578 72865520417998173021622282115897297065499948741333016977205995925449711264176956 26255565094474897108573478690789452301614833936549091418045471744493900137996356 42361056058414977619796545301756403866477665238287263508673564178733233911682717 87520239798540574610685658484484485143626552886914465195322105520677393968715338 46229782138669268844328616467845967527045985474925601179044275148784017318176813 74970075059873044054154223574188383630735787581375577904510295803277047595811506 88347886202004820298234072164578798102282405395551831812610460235149520909164423 20648618577605543413413800622748155200437148815616336134151417567173424439602943 96795477388911002416277634748167511027403229765754512694965485723952644455747553 43168060306136723636386968113782220465168436923882778492243004678312993271604916 00084957054491235773464060062508538151353700030887099389779858751239701530840391 33981254207336028333664731354893652595507160869011064921843568682759417495857874 32005263895786133463851692091466614350528441683254366784051667951235454025522789 70902496499350888999313672501632205793899066893171109890098515794016143955342815 60665027460475685057610039430871276673088018110118746417364051361912801940178788 47184128484415891446703002000412974423947865492104010376472121624256459166539507 05461885765492027247644673183661351539459298258607179913929371586569037859915277 04409192168561353958434091734046209526609913610506852387594371375746030975902241 37949585178981428976026332588545420439166280042234681521426868735709175990226527 29609182887213250871699401075707235495748093170967513032115775630855082270457103 83780700916401163015170147462982096776171564919037821536486862104557363967022121 54236615570360691975792514019007331996422560513559565692138190281762699870724184 80817962949597381670778017908505514365938783224336766190468724380988416620318243 44248423784425483179220818317533408821568421185409698419039283172624867556520196 17664276154892332101325007137377827207198674287842128388448267143083395723766887 65455565809288432163239003386762334751278968846893563921664556803962255759537793 50010551391796810987368958163004427502975389394542519945844023686934331444706256 56264738308793914118105686394139047548275403531607592419943491975572422255795185 85756214500841297480581403228181370559592364251718018549716402493782639902791880 86447994344302911758577109001484905243519348948271987562103583364805682519952559 90222994949660723935010809689552146481807602459130296756730989503225774414308529 80242750850981304307503270888795875565225514325570953541554811135101949694530598 16351028321048349262485012598398906824944333355370818447941995499050282187346105 15597799904277581274436096769561839923985140760374393714195840146201280849951885 08024793464475252900601771045810459386869631030551143770607931095621165714367369 49399078035122255120592857568494116826631853141262494238112791489202517400218896 76054558182061400473878854821187127903750879073649168440523062985266415142595732 16199470479753258028911460834380861087970089406570567584542509494432740408082520 05158455173109408551817777234816263477577966578379081044773048183304201418455896 71000553781667950458618692537831936284855776279193473794457042116428899040731140 62017089018296469567993501581454765905717525908895981700109042843651382816113697 58619454517636421059630933002919203256915490021669791305042943784494423528192413 05179753852182744601230575990443696712162014760078674924637961914412545243423289 94751083891092339932839770150266943044702785949578658631533329160967918467912484 66420231891004702571680020951186621410857696964599161883084999197808790148972838 03666027645979494174300008495495961946595541044468890104907413534299618921132293 39713981170938051368936681611547722976936998509730411843857983323341817962287283 59066935452837989239458353443415784658471069818463921352977764804000098244150325 40432436485414448263243875032236954770624716775796899579057495828742688005246555 31970725080750286590038309189316274051155520404960885999750133437671385726572610 58844320554708157342802330820829983905278610378851459439326556121474247189028660 34174901165695357239622800573939502675176768000321671983644818575446952714406122 58338239946967238455665539115921458785263121710000963090586822746502376098788319 10257023547850801417870815802163413506999318614142593343589917739019360714729378 19642510185836465364090604297586384728340740429396759604168108853433541569653154 47372894674727115813606165685348569440321055100788505951221645664497421450577087 08344344926244010686481657263312213661914787357774210083779609467163980492154592 77116628487431945207926217251705818338078516311758341867752458372991586623080772 16804459895525226990678849609355049416612952744691227104669975830353534839088285 55605505586318899053501743948520777180609497472251300898798013295801879866009978 63339321054036762116138183793042782357382910772740606875290977029857606078927970 61225943884195355790238396773828051457805016974727409349014220017289501682267443 80207214389048514262109425711213343756797810019967472137915782348370456864142822 28793899069840194165136721770570601273547942030390741690331131589038194939373829 57202651155819577575660709998000811273336481968683221076198116301544963619840196 88877650137474003296764397895443803107354090334521467581616132277325643766297677 78109863526724904111153543111692772933183578474232819053975080754666180270825723 80644839602548745668537706723179354270733057623657194964592556181754010212404034 21476951687412461359995572683582576773220852440589785018785976020007991118966046 36483659102229752134557549842542432466873967381751840460776843361026180128373683 06514127666129223105753328107070435746412109893612528362710671866257545525917535 36058538789574873756034219722408191913361322045459027839257670651078643424397488 03187172260823596929148192025635832687051315303270238933964345584600228691969251 53848746496359399271163863444063490240288224503395065763620435593328873639833627 53387890287935287395408899548639582897265472749523835389198259612413548280793021 28707471551027979881841435698205061052724363474130558773024667366304332195026797 53619201647344712491643060584668200960000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000