0

I have got the standard gnome-calculator installed, but as I am dealing with rather large numbers at the moment, I need something more powerful which can actually deal with them without falling over. So for instance at the moment I need to convert this large binary value to decimal, but when using the standard Ubuntu calculator, I find that it is unable to even represent such a large number and simply falls over. I also found a number of online conversion tools which claimed to be able to deal with large numbers, but simply ended up crashing my browser and draining my CPU cores, and not actually giving me an answer, just an error message.

So really my question is, how can I convert and deal with such large numbers in Ubuntu without the tools simply falling over and not being able to deal with it? Can any body recommend me a tool which would be able to deal with such large numbers? Even by splitting the problem up by say calculating small numbers which make up the bigger one and then adding them together or something?


OS Information:

Description:    Ubuntu 15.04
Release:    15.04
10
  • If you want arbitrary precision, the command line bc supports it, and apparently so does KCalc.
    – muru
    May 25, 2015 at 15:18
  • @muru: For what I am doing I need exact precision. Otherwise things will corrupt.
    – user364819
    May 25, 2015 at 15:24
  • Arbitrary precision is what it's called. Aside from programs, various languages support it to (Python's integer is arbitrary precision by default, IIRC).
    – muru
    May 25, 2015 at 15:25
  • 1
    The very first line: "... or sometimes infinite-precision arithmetic". Seriously, Panda, read a little, please!
    – muru
    May 25, 2015 at 15:27
  • 1
    @muru: Could you perhaps convert that into an answer and explain how to do that in bc, and also in KCalc? :)
    – user364819
    May 25, 2015 at 15:59

1 Answer 1

2

Conversion between bases in bc is fairly easy. Just set ibase and obase to the required bases. The default for both is 10, so we can just set ibase to 2. I used a file (named, say, foo) containing:

ibase=2
001000110010000100101111011000100110100100101111011100110110100000001010000010100100011001000110010001100100011001000100100011001000110010001100100011001000100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110010001100100011001000110000101000100011000010100010001100100000010100100110111101101111011101000110100101110100001000000100100001110101011101000110010101110010001000000110100101110011011101000110000101101100011011000111001000001010001000110010000000101101001011010010110100101101001011010010110100101101001011010010110100101101001011010010110100101101001011010010110100101101001011010010110100101101001011010010110100001010001000110000101000100011001000000110111101110000011110010111001001101001011010000111010000100000010011010110100101101000011000010110010101101100001000000110111101100101011011000110010101101110001010000010000001101101011010010110001101100001011001010110110000100000010000010010000001110010011011110110111101110100011010010111010000100000010001000100111100100000011011100110110000100000001010010010001100100000010100110110010101100101

Then did:

BC_LINE_LENGTH=0 bc < foo

And got:

540928155721638924086918713208358788434417421543582007398025141935037001065597779126307030345416152932763078192242002165296106229954746802320567748583763347185478212853751143760813806416888615744551880482630354587304366607401972680065884262510541490557699155628964583159402554268576902882264135962556243262400836720973400124956401049882543283755065968815271497932646828988752833868312831766775697322203661623283608105888116354992561077142244253199952119271560535664760689367070733955259652518580465356203287927104249900193248167970918611574830802565150864679884207701758286782698161317167183746874649374851424212625647735183268282102125722330298233134909640525556015561438701399837522556388933513135621744584178071469708112531395550265265874685017360628813885698355947673102075800592868146846498314366892439194433173009049785218842057219357555710703816876539540549373981950747068475487221385807538982981583758892582356159113797930824348243798067541314916691107657807727899269973612335790994508849402310357135063109363841802013850832833039341705117267300274974922172770739382935897246988186267375540666684309854217274165490358501220880594716147545409403437720568974932997534709589603856843924303666885450827859350799040200910334048954579348331089528105682738149303949572854468875687500880743898081167780496295200930920175473418789027999532104469254458591975148606912833663351309957251471935074750449462341683385434292854364223610892159790159597322715126394106554227171902975003734341684086839488627244161698998581023615716493188409171943277063107364544854644279824726209379471088806124844001225938604570562697680875076958389506783270442517437432056546267492402542750993809301236180450097406515720434936359867191790399745629069519764430331382284953699799681818716349571258784314300847178691858577907754955256555793349022793674314074605859075290896387489284851969597464902861397758662116931298733216874541511884865576132243589880093343144378853809953361771767531607603590045992477100597774201224130770167936473248164984312843522815331618527040539126714837245567046097395218547264596366848976384428510845471081772137481861904548761596193031547597366678724319337214428125621342181296829780853232081402476469948717356376515496139470348621547328931118203970915759446558628378862980758252816844512376308349164642713865128528685756813378861406016509958747160134201752088019982040676813529600987386905895971673763702043560323305802125556893287508358583841725843386699424384456022713792226657900326588728837071086202357787679856943219638527273481408963479024703769435105095103022310652877082969764409903965639292995374253547546225494024174003232684695335605310609305338530434193830115173158857319912924070883041848232544594384702484124121387971388555071652706246715269478748389093993092328175682959127655793124287989860862397767491884936603037279256937285190787226346484214801360991734359192308747285053107141358864051354038780994295686012721089301326976755524556391343138326542060276457012297941401590232862910769104159741097975047152186021090968906542583574255226369152539956016137431812056928383640519664246117338426572254573022098473718235982290375387763365068651085070884582217749629340891317532282698237897695333871760553691925080971473453446444173009767133222878699558193321924309898044650229107541430795328060040958350269496751010405772628119169416691856358380481166054707542620583827639208685757289227446931805961677574953701968330513472365877481402808418056640560591510690781915664120578413558628704361448157650082521966985910009636412441828936970071171700413199716910498168795035438639587102480391329778429405302152403569209621981666739205282867344400465325413380784985668775480552394745133545957728358681708922673716566071550874972201236514975119358854487473232986673293914400076206135184449335917858195555316655103883352798222617060489935762362647565362073134670087965234241567807408646946392171309077703775756026298096827042739559760381613017075325917984739125184959285533488365042734430045245135428221841905876134403293822728253180842801464270059758038483810244021192789295115050646048496330143117965517780443812212846827591005498768293165569320701166335471369330480656010222298241629210663796293707240628098364116400985499447497339801250607357131375089292084390727375422335011492901050151677098631868238872875708462285814083199731941467222294420539780585594528544414609487820070333151669011338030449359165281183735079502024127886293352814030599016021212072074309392582874770366891656863221312585204996521857418206685193346175930475378475968645793703186252466380619277436499675179857433767817666140959640973671615514177869108096268518803174520763094749446801027106024151461466773704927657566618857566150026412761351233356911827590746091798029653283180614459951837699383341502824632380516586857666029978789170124983191777405118710374911782243653303118050678058491637477689875742464689375996471925856990676935650352628713384003367136893837678485434186300674459149498604159948664285776255087988843038224697468755684194041167309670862590365355358538879210904696134673090873196613244349765654824347716580969940302272241496978815370303085735318048456833061087131425397867550603263613770229891529731666663380780533705858617958241210979792271369353787593124905202347646563990851145602089798406715373511987386693506177665067820004734125340300324573380011856712505177532679794021502770775863448607637502612616347799547160077238605563969136580720721417969258998038045512111568511105429440629901482504208766354943077060295234460003972481285613842020612468391230659424162484705700123096618621799186190870339493161625491065272999701279677789563808294981697908245624435560867506791513068097820127946446730013568685796818504041340369949206017476035685854512808573515740281148313308729014311516235442545341164203292003031921605990156473131409799499661407714985806721932917213192551553952152459346504506451529514440371692010104433101718764904914481886460147229544344835043694256757817453732564691515486695328935458184205712103792672714394496796650175835645022061426016983285490799170735701101570674879676900022618358793486052999737396902764908015595223920127839952972435072734531698217120089091337994042573818297968641469836661600344800046656614482781799500881362496916791152277508884356321487581788842876114282776715572788491391231956550259088983323753462806399618366214335151035919149408581389098172223870721570684284752032298966422351960017010728200727779542352839022071435973288503176957688321352762735738482925571430616715167096911730073647363490143137844194417307092239265712870422822411115152870559310896098445146658843423997617047284459218335095740603022207905283312265804516453339044752104700287823850086032839783934683811646502689576057460802180080344789600445673324592530747839048361780934649557506831743603227062988148740346426845900972754129378615756010464797318009828751805640667051121474003539885283201401369682015381475788440936618097688896413670937116592455158090247796179957537715118520351952621024296340947893606101015358540570267763775445786413425466994945303628446897863008029918632939671447679989806444891593536350232125308016047033857209153597517665210467447385123801771233640926347913500085207216361923985376062277878595064587971429980804728514697330912402861545942943296200421236595422521805156662610449052440306651031351230716119854145437957549140168011203973019873026341277528158755218554105658768548377327140499936958470235569671052619278855636752241412784819719907762477883370185553290106109177862549919412087363446890524079588023220342030703702822883661893114215495327054605921416792846453245700590042724612623352148419265348660662890170455190338924196577157671027367914042405460976327750627171938842973873762143512802767564323115727749016840131186211213049045123798266835064629736864502250280189490861268012215367707232042210380972321987338871904211209852670347995505217410236540445240256512875537765088477119029586101265881101911060981481916703599639888433805966074572308843778977614943319524721060013859088616517700249904069414768834019733019412393931059388831657407792528997010120846203502620112108499222549738139375258940272429577570091213300903392143910025376088631257455737784821942852855232781386998960015764850642193327542354929843841056404199099324061022032305170057946356973680591655536188613333394100082740004283436959382536803254050179188823612063179222471999091841763094604016740161387192704042069356630112157299291201187572089254082985249460110732358587899530517066670753260942405321764977858204941601813478275759633023749613619528806605210147594999616361385104883130286931221319770667661411383635153095095328427755823854537457098884913696981246690214280655576140860961347913535853782675109648393091276460155151940730068055819381457371565973052770871758675338579344453596931156750322061093640792866983330893492664632172525078856056128429458953567760307571471496114722393209216179834251554431388828086464780032992017700885757564859927752926055546760734059413401071577508577059834141130834171978392369297946574237445727446937379445843571310301061685621062563642223500993297652963634117959991873862047016866080985429873396279491071511749397786576056532774982020801134146070015744446931309442781358150133670709798953960214976371369337907849886197736890613766708017821491875617172904030141783585491550832093215355417101808480253995458795282848035373512341150109254886467997371897388975854059732723130643350275615111084323790136761704198666869744672485251686949366652468929048062934000286171292405461332936484617686999519304943986779468042040501836246919963938356159129351566308294853314582024491016657818032576779706311935123643239650076733970786309595873916172749316277364111533238239796803423940885081948639533947760772042112313907679289126951977984908092235055555521107008476340237124284039130577154129588625191991653692630751529598374455274411148052758257619390581662231071231373699077352045428469054072995950764518170763792651607814034908189567126690125591961378075754282425559168326674625188961682104587143131657411955593953534372714763768488582297643460582139414612311695142395743276894991992630284797170008373692712435607327441368911428268561979626891414258914935122829843528618332225544431228605439056702251191381944518590545580060419837320108392532217558958944048200551614511937201978649448927213852242395189177012618134929843640644313622960208620688151954087429590194322089420241169022569806159090436967581255791297642517202389040136428663821952509011718427610822950253968408790624257221769835503640351911867401505355165062373519721115242070441209058992484413517176793449346820097258010856899271838026977657975264203094354646549601999077537060749018056056823995233052227695434007319131848235936099162391471483031083926854641255658621032573829733619526531073302357237048803558127421789545488948547848140886288895907789022346675393439390856306403232677519883725742229841913983674439242264008036248063955598579616404522908461476276449723008468497990828174692077779175470626338106078699372903453291939483390099762747869316661225989897146878329752776511643047773850353012673151196343278489877123537151429752313361055568281253713678707032200926957301797609306263775972604402462953618013455103650249693610710395410627581902711455069113614751558230799571176887562400302063187310417347941993037648566059224734820807612734180251067484275074735215109365510574894987255253712154929509575717050193050472848569724724704743814269454430272299723260531007801114253370229792342272700367972181526890264620259154533832899579279484499054874453007899503151934532520052761574687436729779562891705012866874821819868357530350261631074436079698312149517000098815700718232211825375651163552984591967154156513509965874034537982640811988461505191482873836221267875924765980151179903671828081927452728591169081948577523231171572358964859970569671731510078307294413181653568177756825365532638713308111229691961624693434368067512408777135997258855523991492149858879546645314888312616631681106161010002988793755840253319857656854428083692228149176032302262104457603631107617794257516970386991333324292407411010073164007765212501309748866077668737706064457080182267278524137936154121658533616231081255216810016122556969363225803335924010302774288707849824076235267601102448767002397291556245565258524834446683239872079396562351825127878287945026823700750413184675394168348728583423189388791205514861416524960799640543671183450424545077447162493937532721248980386972313041850846467287291960038158013823180428835104239148187044110405641329357182583486368844942589189613664337216358484940887814533852876159310619692926111365976523688740222371832587546814194606178962035473672157389507498977010656497012949437430672536921534980033065211948113132338151560030934896742286315559600283018369600460251746351561119925454162645782321143197282845683028006612076058630530214517247766556456817153366030871776098281612896849472449948171070687845339758817773093790689556828398366722898077096031401629667867032863399485896792578133386645837031543045755815515580503201389902562117877575846064502486577525351055949646979887349002820560444599384996825292465215635278738321148684925085232183226916278107776820210327050731178736781295892768099726520121523603109974372628472341457887499070835986918397395502884842404526958051419317764794261900954402773755277206590589185953636398411181860831432380259168261743671888432920189040181224607625670039364995857444178758815382066912438970528452505440975201372413498775773782176804396850065412380869065677152806639452087953325308454682602206114642542120258157510428605879832535509284084474102263457932609993117367552986809015690936203177221701970094445184971888587902105669483112322732409467615667690067771063728916643895072559994285717481157380306307600776398338562686761470565655378819287241561148554173000906470193535228186209598013107198706827323779658694508976985962406923617005624476319430845995417914780315547754925408658494800221136863079143730390990929584554305396526809133883869644836052896415918345389740953864900669143125967013355966700682552161482958991179393388892800296361842992841221771157769706154450998833992709648156095856994425970896423806311679209916801860486640506432201331997891282953572043363567751218801027625635387866609966030486451128495541053378697263850625439147907169909829595137751437765033546710620247767693742614420112024871191570336480342537148735535681343749293028143949078404214797841705910094543333644063645792217806839243258009646575015798305865046275719646227878469777128193835748009603693517573933091023250065061744161957449230256240713800261253704279349368009487513404719814786674795512100813098475499273104722438621217200032166323317675397742086342314466770489266882410038477667752137871680188578278716807357575139636550694782421335141448191762670047203751262472611930267048692832490248946717050460085290420033782281149340028779533275478988107645665114982255154114489959666468259125249201443799802142390853018131204142564245473263267483258280726948623460960080668234354074658290745389482166010709579610234937842259913155287995445459072597642497677523107870929965705194957066077430040399745512987356683680042054038978469343468268764348008083357760968184834394509415801574743789097085670242408134791935778770748665378064531430467190249869660937905072588004187011935081267182929408720216903422301268950798802361275663226155950075841308799189661255918412580938654276348414872992849263887110410973951870157483632601749384623081741513831192257089893038531044463939777446142597173193265486420029999899590444376075636194610352568048498283809526006099073314084222969889724841047531612958816828496471995200469872764738975417786191273541911796532319219600958861072907430877124479890038292856247905723170037466900773854035818278190263783074733611901499896850606971537740748369110356993407585517589627120892069419861486466038632096710612210997435184455669638185753440879834519872894786904180944800089301978539220965275754733980705032596578252781765477524620968207382026896224214508606553583001560940996944139633818228803374927091538068938745345229431765536918430615288163933595457230376875784004814691471045480892842201690711657271345322698174412987419256739485686180770251680198817390086637865199644753617225925592454949521061940777849371060416437898697894723297570424834982441358711584655456426772512928146485256234414580131155795790777460073406997501582986155871560181454533755667234817044066607969499100543440479666955945883970038990694287975612903983713216836178284368879953027184987923780508377181753099635059356971762531455282307415359201094625141168803797341022004858276568847136649745817756768912152446869145603964699482589604372218850615406041066092802479863835424258099315868354361227530900317035892121224430625017746443353140300768403831589448292751557583302524279003457804075259713387627130955829651001414094162479793195228133308433875833550064016993004860466901396555858499010294862449594940609489725584889464677819382699674835260488987320712326901786050266256829215241640434621879104988243685036690287131927208652477100669410872875572690352511679675944839720004596896769172051236903547886545497649787314020891697029091604513962615591258302791176506623804252326951993697967063349727680289766565366580729511038520211849084867479679858132563837329643769600415880142106597309169408518676401611772188566765179822425978940904017028012187195829317661463899533884179018543011512181435707222687621029933010712896497597066445418414555945759794147396911013171512393141173844251689557921404703042329282218502815785537655816325326442629402458657740526801548500173792715002248351350462516303887840570465538674191539208178696813816533317072692517512888975121507841680123563576289456171974781423489219704719570933160681299910727891594202488353277077630411106881607107502254730194439739845760221652199852252019220986871867271833650587117499750967631515135398762980139977677135373585421811087661697467109989400371645208614481580021103120949008432049065004827227733437921601801358705608998606880788971961915331469395992539461729235823426174798963632429069172524835912771425623396553145077982840705413497143128727419449217785492674011656459044483151721619126132623009232532289842745730601070278029834070536803821329487391266384597296104120299249488628433662268981134338244172181725241394555450625821585175304574427378660322724528972105242082321144737715150299734258479143279865758360592146738603700056339960631713256945955563864324093311702318109258622548835888760083402659385665998007939242062910718937439047760230297849910237285133725908608334982308577575917848522009763397395069022760817844920006117642124800375518670935201310096494604603712076580259409523298474965738454909880206274770356114920840872323427931213808846343025019219933956425886856297832607288718082312429931227175702363752977653629508044693983165149909524554280699983204657821208639790420469238732451027426461327866616281454389705578612970015539794295074169437682764076639064275656268049680410261297951418798660769957899851159404553317547395744358832038046856933650953392638295115066977015237841148452505359377227119410675904926135276768783162733636313697444296291390162512845259000471680020334289942981476457309543209992486509372530209907148578361639651828866923222531171473696367769629717415819920435969632819597385488886557206252530092067804316606760001346399803001401522915386755056133667575747236074305023808959945690623825137557137623413494500488419902198414147932114701494580789783149328799389088594437408743844318692101567293978229797852934309987153588030889074484116228882904080182875901062634317712919085152791576633554876859672105855481577090698226573908968765818766165412279324894142162336280263240753208535475755461630438906517427803852973995449157637400190296871722406738338402139842402313138020142720687075259861556382940281488181974286285685374151362895226434182131237221842295126257001533004860790820490935756067877746582749865439454792131201330464847660036897351206648516385950348187265817073176247897197255381656977256932756670059630367325578978820144735462154994169858643722519002999550720765940563649952561055802868341928451219947468470053658126668062372907128592309626122272794055037695086691098063490598952833046889135434738911171186305751612690722478661327333386192308980843504946637297764113529549157620070663912514382330403715407802911549376694586240909875562366201093852663242933206022216078082648003940283580514904847467516288638005126249076266620090258647388751616985010311655560496956209049607368183005755818965470770620464625807444457323579178297889262107819709193223223835906615163672423877062065736876544549554261729662536624339163715059786552224179485251903360963810527034771227729745591192743891310580250918661045158529074006309233078026815113706790211070605378119588480767803585263715431571151888280085231424038309570372818183785200060611762391872322787945943151435256330100606724496874929473426110405729639850266035319438191365931304354926441330578083838012937665921863696648199771148093528136157021897086395595965754415412835666093209793534795560644940815146905603638448772735145047722086831554739556964985107455587303392662123146962417829081673909735871748618151085711972671324566135271397021464722577442750977380827764661348517138293413109065684395308163493818664349386293684486085595121606540722396023950263360508658611668430553213531224677135684690914110710133906632929720266420245274291025295889091801201370377142529891106947298036217751507090824347904168868452840450915171577347626904891859903219889668186068714676413459230297291329202368344209538895901049946976605186119357173973278787746043739502650414186769612319748479925903132359498015464458419265600313168869483205987618394736325316244516307014010765024527781030449768577984555684357042853948385442080416689982002461891765493170507982817261409940552399875974405257206466028867912404927973765733792416936860136520676943231150528215622460966492219153292703811697590092847143160144719621036932153852388655466546146940447173619659401689453453568401809390306855619292676964550422578889204590278537763133841179272776767507196171196701995748927673061968853010561505257484565238169798034313493942742062634198248546349815345631347804060362465733585176228652771162666382059417747080990433748924647344939184328178631068937734534870437450906318007898887164669449097681676080302385416486898617320986424810959094419225755760391277824217763527838816378952779016455547873765386998142364608216420634434080864274481744683938857200312306998482152147811081897826936617184166022685327408271449891112560589067380249892154464111243384540020460397787906460489673561025721322264138123630687033131422216636375960068332982892950730754636582889522122293746331078590937626765494253439236306192486104339478707168798654606049143947785052348839292342370217654041022003571514997533659211273565615467580896938210676991319161743027450427540428183344077673192934029786298566548874247442786059617905299886537450209682696845617282342565358813391607862434288339524783657492451539149797213765478496996504398828575328313181376429102205075942651953309625848264914383334692335788813115002363420185894337365233781715534821337408217961125597926554706871588458935318228226949464330704041681831529903024520248040901380173102579509672956019276805715293947768287150323662677273648266405753380317899112252933340906202284886112391326030638866828090178880653735485311764847551615080185283434954728127925384535030694424914104563126180419107565748824740304950629972467315779357915542445132849016817905414782440795946914698188888647033572599742681820213457671771147257627098576247927306014481277688863725498958743399548727428672874482164432332914819035005961487757632290098035375547049961109127814522419819446619091283333369479110961923374454148665661069177949830685980871176531808187110463163543269099931320495345574623489501162067456352763103373949233510618156808799897404597047545905620882899828221727548733491512701791086830330757223289382812352747552035807091414786353351374150877363834594606575671153775027377950852792212627960203974471012397285475263019181669322595640337377066662919108411156257024126095246255442218126144916942791776967942548141168064606390737782795198120247358025233608174732702795373998734718022776525009353875853184362105650253157866604117648140264617162356504691441302513477297054812085254030749905430702593434997777026660046294160264820738100485451287917145491978894271248161390265370521946232280786732837169732758718793984692983845313796974046817514500582657811198391781158073267155247516862108370701260525478014425582059625462694971886982161120579556682292458327552074316491753809925791587262247992984470735032633665188635258544000477856076702708986358498262622063433507734552775913221877154578289583956765747555309388022023799330022966882861896818128154375907197275462648514106610004805520875706032859294412477471184960330717934571342284888409008338728943597554798486129397742138855034996516289619795102097202061962446606263816248115852284112682975035724280724953583629478911063346627341129899604740895494395312106562702326864321040008947643678126969000315550638059160674527014412661109211024568446632522207439374887514007165840904989819162680451127163622025806417687374148525621943397567653255512081930090178241737251650465048996591314187082260059330988618814391540346860840031723832772627712010916093783024227870912892877556070884940825376513465477851647328966422242624834403728210267327653635629053843109133786103543136490303345862462855672052760467762906333062375230588255089459215488310658230529704067552945569043420104610583671920065461681756181446316082442103647870094026489666523730042788978339087622450667927923289756447429024498030508181566293409881990798916112182785285205455181846865648970202211464848369906675902712387042238245603904448608138863170928627175643025754140514092765450815837974256612301204292317774142754481194035643011553418467681574039147190996826512044412924500346586188859012968037914647302073388431253365051137933668394615774480290604107467665272745861019169999287047562099867126792705149615172760949138702578193505684167742379373789061938484398226922108325347476082942270850391102444578650896653301035025348106029413430792954928531968707896615029235938479706301787493867260782548189743282308399573645223830651492189491866927892060043846411723801675950392806463787560076482163349876517074971874173878852438850156830644435531001045082456985955878156768528750618780131129180319528568738657886044239802882515276353619431071118474070648192832219987748872659780695975238634339962023430198657892131106503429198111318235817939384851562431578698123676556762921783362348806575569223735388251668740604257924078030004427991945819640114794576912520008745947203649357785695753442668736323658788573027481777311068477557820489316707332266677176784759682805725590069600110697164749797364997686479164620036144539749500853748984608297095222450214499361207388345321032656766020726057031448447309844028604331535881064008651930193406505179841945946681533779002355924459474150646151285303272996333561046245491557029420384489977854999648026592906625194573074374313405392605175780026240559487806222028399879399737768605324956420161253204826888513589859374608986547885250194235678666371578003226833199339010496755634683583065070719399249295227282109548744

bc prints output split into multiple lines if it exceeds the length, so if you have a very long number, set BC_LINE_LENGTH to 0 to make it print in one line.

14
  • So is ibase the base which I am inputting, and obase, they base that is being outputted?
    – user364819
    May 25, 2015 at 16:32
  • Yep, input base and output base, respectively. "ibase and obase define the conversion base for input and output numbers. "
    – muru
    May 25, 2015 at 16:32
  • When I execute the command I just get: (standard_in) 1: illegal character: _ (standard_in) 1: illegal character: L (standard_in) 1: illegal character: I (standard_in) 1: illegal character: N (standard_in) 1: syntax error (standard_in) 1: illegal character: _ (standard_in) 1: illegal character: L (standard_in) 1: illegal character: N (standard_in) 1: illegal character: G (standard_in) 1: illegal character: T (standard_in) 1: illegal character: H.
    – user364819
    May 26, 2015 at 10:09
  • @ParanoidPanda where did you put BC_LINE_LENGTH=0, I wonder.
    – muru
    May 26, 2015 at 10:11
  • I created the file in my home directory, then went to Terminal and executed the command (after executing bc). Is that not where I am meant execute the command?
    – user364819
    May 26, 2015 at 10:16

You must log in to answer this question.