[Ilugc] Python Help - How it handles very large numbers ?

  • From: carti@xxxxxxxxxxxxxx (carti)
  • Date: Sat Aug 9 07:27:13 2008

Hi,

I read/learnt that, Python handles very large numbers easily and
gracefully using the long int. For example when C does not handle (2 power
1500) and when Java does not handle (2 power 1500) in normal
scenario(other than BigNum) due to datatype size overflows how python is
able to do that with infinite length number and infinite precision.

I am looking for the algorithm or to learn how Python handles/works with
large numbers. I searched in internet but did not get proper expected
result/theory behind it.

Could someone point me to the correct link where I can learn how python
handles large numbers.

when I did 2**1500 (2 power 1500) in python it resulted nicely in

350746621104340387476275879602808579935240158803308288240757980247909
638505633222036570808865849692616531504067954375173992945489414699597
541710389180047008478899564853290972644868027115834629465366821843401
386294513554582649463425253836193893149606446650525517514423355092491
733611303557961097098855806743139542102176578474326267607330047532753
171921336747035633727832970419932270526633336685099520001750533555290
58880434182538386715523683713208549376L

Thanks & Regards,
carti

Other related posts: