Integer roots: Difference between revisions

m
Corrected decimal point for cube root and 7th root (by changing the input), left note about it.
m (→‎{{header|Ring}}: Remove vanity tags)
m (Corrected decimal point for cube root and 7th root (by changing the input), left note about it.)
Line 204:
 
<code><.@%:</code> satisfies this task. Left argument is the task's N, right argument is the task's X:
 
'''Note:''' Depending on '''''N''''', one must select the proper number of digits, that is, ''2000'', ''2001'', ''2002'', etc..., otherwise the result will be the digits of the nth root of 20, 2000, etc...<br/>
For example, If you use "3 <.@%: (2*10x^2*200'''0''')" instead of "3 <.@%: (2*10x^2*200'''1''')", you will get an output starting with "271441761659490657151808946...", which are the first digits of the cube root of 20, not 2.
 
<lang J> 9!:37]0 4096 0 222 NB. set display truncation sufficiently high for our results
Line 209 ⟶ 212:
2 <.@%: (2*10x^2*2000)
141421356237309504880168872420969807856967187537694807317667973799073247846210703885038753432764157273501384623091229702492483605585073721264412149709993583141322266592750559275579995050115278206057147010955997160597027453459686201472851741864088919860955232923048430871432145083976260362799525140798968725339654633180882964062061525835239505474575028775996172983557522033753185701135437460340849884716038689997069900481503054402779031645424782306849293691862158057846311159666871301301561856898723723528850926486124949771542183342042856860601468247207714358548741556570696776537202264854470158588016207584749226572260020855844665214583988939443709265918003113882464681570826301005948587040031864803421948972782906410450726368813137398552561173220402450912277002269411275736272804957381089675040183698683684507257993647290607629969413804756548237289971803268024744206292691248590521810044598421505911202494413417285314781058036033710773091828693147101711116839165817268894197587165821521282295184884720896946338628915628827659526351405422676532396946175112916024087155101351504553812875600526314680171274026539694702403005174953188629256313851881634780015693691768818523786840522878376293892143006558695686859645951555016447245098368960368873231143894155766510408839142923381132060524336294853170499157717562285497414389991880217624309652065642118273167262575395947172559346372386322614827426222086711558395999265211762526989175409881593486400834570851814722318142040704265090565323333984364578657967965192672923998753666172159825788602633636178274959942194037777536814262177387991945513972312740668983299898953867288228563786977496625199665835257761989393228453447356947949629521688914854925389047558288345260965240965428893945386466257449275563819644103169798330618520193793849400571563337205480685405758679996701213722394758214263065851322174088323829472876173936474678374319600015921888073478576172522118674904249773669292073110963697216089337086611567345853348332952546758516447107578486024636008
3 <.@%: (2*10x^2*20002001)
125992104989487316476721060727822835057025146470150798008197511215529967651395948372939656243625509415431025603561566525939902404061373722845911030426935524696064261662500097747452656548030686718540551868924587251676419937370969509838278316139915512931369536618394746344857657030311909589598474110598116290705359081647801147352132548477129788024220858205325797252666220266900566560819947156281764050606648267735726704194862076214429656942050793191724414809204482328401274703219642820812019057141889964599983175038018886895942020559220211547299738488026073636974178877921579846750995396300782609596242034832386601398573634339097371265279959919699683779131681681544288502796515292781076797140020406056748039385612517183570069079849963419762914740448345402697154762285131780206438780476493225790528984670858052862581300054293885607206097472230406313572349364584065759169169167270601244028967000010690810353138529027004150842323362398893864967821941498380270729571768128790014457462271477023483571519055067220848184850092872392092826466067171742477537097370300127429180940544256965920750363575703751896037074739934610144901451576359604711119738452991329657262589048609788561801386773836157730098659836608059757560127871214868562426845564116515581793532280158962912994450040120842541416015752584162988142309735821530604057724253836453253356
27144176165949065715180894696794892048051077694890969572843654428033085563287658494871973768515010449601702702662017016622108188038292129512829222732037939681464769491319263029308919709511736401200395299672806902057959507281705818417585572775465293620106435558459837272246448049135012971629241921717289904494332635356114519208640365765906522454723182775121756558058020787429240528065700321862315922465987881667832001482693220149093231249941256750252873117504822276540899360702266289427386749058832442643990936924594623694605667125995688788028079451303313515777223983018552490248388121970980055977541748894293734175182220013380497630428176870053423294103392285168797917553010332228664978678396929617114885278335650885524410898341213271192520021355449870508579216359067962061031950345530646092202370608763454397416764433915183368398263533906772869972563479248093751375796381425079119097628053496428734814910307755317031117606073779997125797512066497555354285360734633889394275558674944424368960732987910929093583629174893939036518727793282632439102479840614327136348027409016670160346303867705846755103908964945780837562103026771901489757443287280572195601219016859180373403783498753667545621963282035797597576337893795984255961467481252116653755272803423453851317757500585155874395469445425245653837328715044666730082806623655698726925
5 <.@%: (2*10x^2*2000)
114869835499703500679862694677792758944385088909779750551371111849360320625351305681147311301150847391457571782825280872990018972855371267615994917020637676959403854539263226492033301322122190625130645468320078386350285806907949085127708283982797043969640382563667945344431106523789654147255972578315704103326302050272017414235255993151553782375173884359786924137881735354092890268530342009402133755822717151679559278360263800840317501093689917495888199116488588871447782240220513546797235647742625493141141704109917646404017146978939243424915943739448283626010758721504375406023613552985026793701507511351368254645700768390780390334017990233124030682358360249760098999315658413563173197024899154512108923313999675829872581317721346549115423634135836394159076400636688679216398175376716152621781331348
7 <.@%: (2*10x^2*20002002)
1104089513673812337649505387623344721325326600780124165514532464142106322880380980716598289886302005146897159065579931253969214680430855796510648058388081961639198643922155838145512343974763395078906646859029211806139421440562835192195007740110439139292223389537903767320705032063903809884944457070845279252405827307254864679671836816589429995916822424590361601902611505690284386526869351720866524568004847701822070064334667580822044823960984514550922242408608825451442062850448298384317793721518676765230683406727811327252052334859250776811047221310365241746671294399050316</lang>
29619362959451736245702628695019269518064618216015009169507699742781423769947484925822512257735101524178182602734424986961003971858127002794053824818478879396020132662403256874761276690431037137165264232256601651438511207764019815767975124455844526943932927494896013055497926678521360177960529077012650088983239249505488961115547364229473827474458408002500739618874659540108997885564940730803150961523774615079827002013042942440654069714159530336055547627964891459096727426898214883744931710925020592035759639587602673656267343846153343265577563529779031634608306646526796</lang>
 
=={{header|Java}}==