computing with numbers values these values are centered at to represent range of positive and negative integers now to sothe range of integers that can be represented in bit int value is - the reason for the - on the high end is to account for the representation of in the top half of the range given this knowledgelet' try to make sense of what' happening in the java factorial example if the java program is relying on -bit int representationwhat' the largest number it can store python can give us quick answer ** - notice that this value (about billionlies between (about millionand (about billionthat means the java program is fine for calculating factorials up to but after that the representation "overflowsand the results are garbage now you know exactly why the simple java program can' compute of course that leaves us with another puzzle why does the modern python program seem to work quite well computing with large integers at firstyou might think that python uses the float data type to get us around the size limitation of the ints howeverit turns out that floats do not really solve this problem here is an example run of modified factorial program that uses floating point numbers please enter whole number the factorial of is + although this program runs just fineafter switching to floatwe no longer get an exact answer very large (or very smallfloating point value is printed out using exponentialor scientificnotation the + at the end means that the result is equal to you can think of the + at the end as marker that shows where the decimal point should be placed in this caseit must move places to the right to get the actual value howeverthere are only digits to the right of the decimalso we have "lostthe last digits rememberfloats are approximations using float allows us to represent much larger range of values than -bit intbut the amount of precision is still fixed in facta computer stores floating point numbers as pair of fixed-length (binaryintegers one integer represents the string of digits in the valueand the second represents the exponent value that keeps track of where the whole part ends and the fractional part begins fortunatelypython has better solution for largeexact values python int is not fixed sizebut expands to accommodate whatever value it holds the only limit is the amount of memory the computer has available to it when the value is smallpython can just use the computer' underlying int representation and operations when the value gets largerpython automatically converts to representation using more bits of coursein order to perform operations on larger numberspython has to break down the operations into smaller units that the computer hardware is able to handle sort of like the way you might do long division by hand these operations will not be as efficient (they require more steps)but they allow our python ints to grow to arbitrary size and that' what allows our simple factorial program to compute some whopping large results this is very cool feature of python