Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Python Basics 05 large integers in python language

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Lesson 5 large integers in python language

Int in java can handle up to 2 ^ 31-1 (2147483647) minimum-2 ^ 31 (- 2147483647).

But in Java, you can use BigInteger to handle large wireless numbers.

Print(2 ** 60)结果为1152921504606846976print(2 ** 600)4149515568880992958512407863691161151012446232242436899995657329690652811412908146399707048947103794288197886611300789182395151075411775307886874834113963687061181803401509523685376In [7]: print(2 ** 6000) 1513470582304237072513410067329391955423482356622077508836389416646889306993564534635830817676552455824162236150182627025523267446014684388515185452610872385131925014977944482910893194864870039450549067298170721939711827195277899152348801107671644590882157659897905715342306574668169658354699728703352747795407934837779271083755217530954282733292552820320384388452736605849854097009866199175847289532126439677946323677218741195176031143605520246681993939075046911841617410627221987267713724332646446061053160572807286503464245558500643221584631072641658731573097806459864337910226647829569494284055229751599736619753728848188090692318773574702174698843299086831373062575703757942149263399264787530048897154373819381136097105118607145954825590031647682047062652157439770794084025717418220995063370720546665168546633747096935011148065108431975289654040627344874607009807315363771104716985869481861040739858883444667635709902593581610755376089941291884120821811227210157156298148402819214731929270895508821230096451968194267364284229325768503489509991935215231081649023894346868133110803328310541268950321043061542938876190012860779210104580276403692887034246086754314279566458942937081999323928294877166406222310453677892068557340540597459094762172544492440478876793960002924059634516299394201455941482615164498572903667144188855598846763146090065079005267746644237582086328585101060359200085939560982221139190410290320736471223679431103604473374855519720454278533708018865824147794661166033633485429613879963993123931400014731049432239676739743030689374442267266097857265402044759137688500162237085777842605048998997700656346545264515630042484382164065996643359816205614528690639187167278480340820347644352745397902032133004265874403392556745361780498817583655041048101434716704942594567023160800649072869376

/ / that's why python is especially suitable for scientific computing, because it can count a very large number of python, basically without considering the problem of overflow.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report